Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

✅ Fix query unit tests + Bump package_info_plus package #803

Open
wants to merge 6 commits into
base: master
Choose a base branch
from
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
🐛 Fix basic filter
  • Loading branch information
istornz committed Apr 18, 2024
commit 7ac70c5859de2d4eaa4893841f0928d32ed1c344
25 changes: 12 additions & 13 deletions templates/dart/test/query_test.dart.twig
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,10 @@ import 'package:test/test.dart';
import 'package:flutter_test/flutter_test.dart';
{% endif %}

class BasicFilterQueryTest<V> {
class BasicFilterQueryTest<V, E> {
final String description;
final V value;
final List<V> expectedValues;
final E expectedValues;

BasicFilterQueryTest({
required this.description,
Expand All @@ -26,37 +26,36 @@ extension StringJSON on String {
void main() {
group('basic filter tests', () {
final tests = [
BasicFilterQueryTest<String>(
BasicFilterQueryTest<String, List<String>>(
description: 'with a string',
value: 's',
expectedValues: ['s'],
),
BasicFilterQueryTest<int>(
BasicFilterQueryTest<int, List<int>>(
description: 'with an integer',
value: 1,
expectedValues: [1],
),
BasicFilterQueryTest<double>(
BasicFilterQueryTest<double, List<double>>(
description: 'with a double',
value: 1.2,
expectedValues: [1.2],
),
BasicFilterQueryTest<double>(
BasicFilterQueryTest<double, List<double>>(
description: 'with a whole number double',
value: 1.0,
expectedValues: [1.0],
),
BasicFilterQueryTest<bool>(
BasicFilterQueryTest<bool, List<bool>>(
description: 'with a bool',
value: false,
expectedValues: [false],
),
// FIXME: seems to be not working for now... bug?
// BasicFilterQueryTest<List<String>>(
// description: 'with a list',
// value: ['a', 'b', 'c'],
// expectedValues: [['a', 'b', 'c']],
// ),
BasicFilterQueryTest<List<String>, List<String>>(
description: 'with a list',
value: ['a', 'b', 'c'],
expectedValues: ['a', 'b', 'c'],
),
];

group('equal()', () {
Expand Down