From 5ccbef4a9a386ae492160a34e2147b217ab1e426 Mon Sep 17 00:00:00 2001 From: Job Guldemeester Date: Tue, 8 Aug 2023 08:27:39 +0200 Subject: [PATCH 1/5] :arrow_up: Updated dart requirements to >3. Removed dart code metrics because its discontinued. --- lib/src/test_parameters.dart | 2 +- pubspec.yaml | 9 ++++----- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/lib/src/test_parameters.dart b/lib/src/test_parameters.dart index ba93a7a..6e8e680 100644 --- a/lib/src/test_parameters.dart +++ b/lib/src/test_parameters.dart @@ -37,7 +37,7 @@ typedef p10 = TestParameters10; /// Provides a interface for implementing test body classes. -abstract class TestParameters { +abstract interface class TestParameters { abstract final Function body; abstract final int count; diff --git a/pubspec.yaml b/pubspec.yaml index 6be9e16..4a2b4b9 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -1,15 +1,14 @@ name: parameterized_test description: Simple package that helps with executing parameterized tests. Inspired by JUnit ParameterizedTest. -version: 1.0.0 +version: 1.1.0 homepage: https://www.github.com/DutchCodingCompany/parameterized_test environment: - sdk: '>=2.17.0 <3.0.0' + sdk: '>=3.0.0 <4.0.0' dependencies: - meta: ^1.7.0 + meta: ^1.9.1 test: ^1.20.0 dev_dependencies: - lints: ^2.0.1 - dart_code_metrics: ^5.7.0 + lints: ^2.1.1 \ No newline at end of file From 1369d34f8cfccbd1c55ba1989d1d12da0330037a Mon Sep 17 00:00:00 2001 From: Job Guldemeester Date: Tue, 8 Aug 2023 09:35:26 +0200 Subject: [PATCH 2/5] :sparkles: Added extra parameterizedTests function with X arguments. --- lib/src/parameterized_test_base.dart | 2 - lib/src/parameterized_test_numeric.dart | 374 ++++++++++++++++++++++++ lib/src/test_source.dart | 2 +- 3 files changed, 375 insertions(+), 3 deletions(-) create mode 100644 lib/src/parameterized_test_numeric.dart diff --git a/lib/src/parameterized_test_base.dart b/lib/src/parameterized_test_base.dart index fd54262..0236f22 100644 --- a/lib/src/parameterized_test_base.dart +++ b/lib/src/parameterized_test_base.dart @@ -24,7 +24,6 @@ import 'value_source.dart'; /// ); /// ``` @isTestGroup -//ignore: long-parameter-list void parameterizedTest( /// Test description. Object description, @@ -83,7 +82,6 @@ void parameterizedTest( /// ); /// ``` @isTestGroup -//ignore: long-parameter-list void parameterizedGroup( /// Group description. Object description, diff --git a/lib/src/parameterized_test_numeric.dart b/lib/src/parameterized_test_numeric.dart new file mode 100644 index 0000000..c15f11e --- /dev/null +++ b/lib/src/parameterized_test_numeric.dart @@ -0,0 +1,374 @@ +import 'package:meta/meta.dart'; +import 'package:test/test.dart'; + +import '../parameterized_test.dart'; + +/// Parameterized test with 1 input arguments. See [parameterizedTest] for more info. +@isTestGroup +void parameterizedTest1( + /// Test description. + Object description, + + /// List of test values. For each values in the list a test will be executed. + Iterable values, + + /// The test body which is executed for each test value. + /// See [TestParameters] for more info on different bodies. + dynamic Function(A1) body, { + dynamic Function()? setUp, + + /// Provide a tearDown function to the `group` test. + dynamic Function()? tearDown, + String? testOn, + Timeout? timeout, + dynamic skip, + dynamic tags, + Map? onPlatform, + int? retry, +}) => + parameterizedTest( + description, + values, + p1(body), + setUp: setUp, + tearDown: tearDown, + testOn: testOn, + timeout: timeout, + skip: skip, + tags: tags, + onPlatform: onPlatform, + retry: retry, + ); + +/// Parameterized test with 2 input arguments. See [parameterizedTest] for more info. +@isTestGroup +void parameterizedTest2( + /// Test description. + Object description, + + /// List of test values. For each values in the list a test will be executed. + Iterable values, + + /// The test body which is executed for each test value. + /// See [TestParameters] for more info on different bodies. + dynamic Function(A1, A2) body, { + dynamic Function()? setUp, + + /// Provide a tearDown function to the `group` test. + dynamic Function()? tearDown, + String? testOn, + Timeout? timeout, + dynamic skip, + dynamic tags, + Map? onPlatform, + int? retry, + }) => + parameterizedTest( + description, + values, + p2(body), + setUp: setUp, + tearDown: tearDown, + testOn: testOn, + timeout: timeout, + skip: skip, + tags: tags, + onPlatform: onPlatform, + retry: retry, + ); + +/// Parameterized test with 3 input arguments. See [parameterizedTest] for more info. +@isTestGroup +void parameterizedTest3( + /// Test description. + Object description, + + /// List of test values. For each values in the list a test will be executed. + Iterable values, + + /// The test body which is executed for each test value. + /// See [TestParameters] for more info on different bodies. + dynamic Function(A1, A2, A3) body, { + dynamic Function()? setUp, + + /// Provide a tearDown function to the `group` test. + dynamic Function()? tearDown, + String? testOn, + Timeout? timeout, + dynamic skip, + dynamic tags, + Map? onPlatform, + int? retry, + }) => + parameterizedTest( + description, + values, + p3(body), + setUp: setUp, + tearDown: tearDown, + testOn: testOn, + timeout: timeout, + skip: skip, + tags: tags, + onPlatform: onPlatform, + retry: retry, + ); + +/// Parameterized test with 4 input arguments. See [parameterizedTest] for more info. +@isTestGroup +void parameterizedTest4( + /// Test description. + Object description, + + /// List of test values. For each values in the list a test will be executed. + Iterable values, + + /// The test body which is executed for each test value. + /// See [TestParameters] for more info on different bodies. + dynamic Function(A1, A2, A3, A4) body, { + dynamic Function()? setUp, + + /// Provide a tearDown function to the `group` test. + dynamic Function()? tearDown, + String? testOn, + Timeout? timeout, + dynamic skip, + dynamic tags, + Map? onPlatform, + int? retry, + }) => + parameterizedTest( + description, + values, + p4(body), + setUp: setUp, + tearDown: tearDown, + testOn: testOn, + timeout: timeout, + skip: skip, + tags: tags, + onPlatform: onPlatform, + retry: retry, + ); + +/// Parameterized test with 5 input arguments. See [parameterizedTest] for more info. +@isTestGroup +void parameterizedTest5( + /// Test description. + Object description, + + /// List of test values. For each values in the list a test will be executed. + Iterable values, + + /// The test body which is executed for each test value. + /// See [TestParameters] for more info on different bodies. + dynamic Function(A1, A2, A3, A4, A5) body, { + dynamic Function()? setUp, + + /// Provide a tearDown function to the `group` test. + dynamic Function()? tearDown, + String? testOn, + Timeout? timeout, + dynamic skip, + dynamic tags, + Map? onPlatform, + int? retry, + }) => + parameterizedTest( + description, + values, + p5(body), + setUp: setUp, + tearDown: tearDown, + testOn: testOn, + timeout: timeout, + skip: skip, + tags: tags, + onPlatform: onPlatform, + retry: retry, + ); + +/// Parameterized test with 6 input arguments. See [parameterizedTest] for more info. +@isTestGroup +void parameterizedTest6( + /// Test description. + Object description, + + /// List of test values. For each values in the list a test will be executed. + Iterable values, + + /// The test body which is executed for each test value. + /// See [TestParameters] for more info on different bodies. + dynamic Function(A1, A2, A3, A4, A5, A6) body, { + dynamic Function()? setUp, + + /// Provide a tearDown function to the `group` test. + dynamic Function()? tearDown, + String? testOn, + Timeout? timeout, + dynamic skip, + dynamic tags, + Map? onPlatform, + int? retry, + }) => + parameterizedTest( + description, + values, + p6(body), + setUp: setUp, + tearDown: tearDown, + testOn: testOn, + timeout: timeout, + skip: skip, + tags: tags, + onPlatform: onPlatform, + retry: retry, + ); + +/// Parameterized test with 7 input arguments. See [parameterizedTest] for more info. +@isTestGroup +void parameterizedTest7( + /// Test description. + Object description, + + /// List of test values. For each values in the list a test will be executed. + Iterable values, + + /// The test body which is executed for each test value. + /// See [TestParameters] for more info on different bodies. + dynamic Function(A1, A2, A3, A4, A5, A6, A7) body, { + dynamic Function()? setUp, + + /// Provide a tearDown function to the `group` test. + dynamic Function()? tearDown, + String? testOn, + Timeout? timeout, + dynamic skip, + dynamic tags, + Map? onPlatform, + int? retry, + }) => + parameterizedTest( + description, + values, + p7(body), + setUp: setUp, + tearDown: tearDown, + testOn: testOn, + timeout: timeout, + skip: skip, + tags: tags, + onPlatform: onPlatform, + retry: retry, + ); + +/// Parameterized test with 8 input arguments. See [parameterizedTest] for more info. +@isTestGroup +void parameterizedTest8( + /// Test description. + Object description, + + /// List of test values. For each values in the list a test will be executed. + Iterable values, + + /// The test body which is executed for each test value. + /// See [TestParameters] for more info on different bodies. + dynamic Function(A1, A2, A3, A4, A5, A6, A7, A8) body, { + dynamic Function()? setUp, + + /// Provide a tearDown function to the `group` test. + dynamic Function()? tearDown, + String? testOn, + Timeout? timeout, + dynamic skip, + dynamic tags, + Map? onPlatform, + int? retry, + }) => + parameterizedTest( + description, + values, + p8(body), + setUp: setUp, + tearDown: tearDown, + testOn: testOn, + timeout: timeout, + skip: skip, + tags: tags, + onPlatform: onPlatform, + retry: retry, + ); + +/// Parameterized test with 9 input arguments. See [parameterizedTest] for more info. +@isTestGroup +void parameterizedTest9( + /// Test description. + Object description, + + /// List of test values. For each values in the list a test will be executed. + Iterable values, + + /// The test body which is executed for each test value. + /// See [TestParameters] for more info on different bodies. + dynamic Function(A1, A2, A3, A4, A5, A6, A7, A8, A9) body, { + dynamic Function()? setUp, + + /// Provide a tearDown function to the `group` test. + dynamic Function()? tearDown, + String? testOn, + Timeout? timeout, + dynamic skip, + dynamic tags, + Map? onPlatform, + int? retry, + }) => + parameterizedTest( + description, + values, + p9(body), + setUp: setUp, + tearDown: tearDown, + testOn: testOn, + timeout: timeout, + skip: skip, + tags: tags, + onPlatform: onPlatform, + retry: retry, + ); + +/// Parameterized test with 10 input arguments. See [parameterizedTest] for more info. +@isTestGroup +void parameterizedTest10( + /// Test description. + Object description, + + /// List of test values. For each values in the list a test will be executed. + Iterable values, + + /// The test body which is executed for each test value. + /// See [TestParameters] for more info on different bodies. + dynamic Function(A1, A2, A3, A4, A5, A6, A7, A8, A9, A10) body, { + dynamic Function()? setUp, + + /// Provide a tearDown function to the `group` test. + dynamic Function()? tearDown, + String? testOn, + Timeout? timeout, + dynamic skip, + dynamic tags, + Map? onPlatform, + int? retry, + }) => + parameterizedTest( + description, + values, + p10(body), + setUp: setUp, + tearDown: tearDown, + testOn: testOn, + timeout: timeout, + skip: skip, + tags: tags, + onPlatform: onPlatform, + retry: retry, + ); \ No newline at end of file diff --git a/lib/src/test_source.dart b/lib/src/test_source.dart index 736bddd..447a6ae 100644 --- a/lib/src/test_source.dart +++ b/lib/src/test_source.dart @@ -1,6 +1,6 @@ import 'test_parameters.dart'; -abstract class TestSource { +abstract interface class TestSource { void executeTests(TestParameters body); void executeGroup(TestParameters body); } From 2c1bc9f931a9de11cb742bfa0dbd26300edea96f Mon Sep 17 00:00:00 2001 From: Job Guldemeester Date: Fri, 11 Aug 2023 14:04:35 +0200 Subject: [PATCH 3/5] :bug: Fixed issues where async tests where execute correctly --- lib/src/test_options/group_test_options.dart | 2 +- lib/src/test_options/test_options.dart | 2 +- lib/src/test_parameters.dart | 42 ++++++++++---------- lib/src/util/test_value_helpers.dart | 4 +- lib/src/value_source.dart | 4 +- 5 files changed, 27 insertions(+), 27 deletions(-) diff --git a/lib/src/test_options/group_test_options.dart b/lib/src/test_options/group_test_options.dart index a11a5fb..1ebffe4 100644 --- a/lib/src/test_options/group_test_options.dart +++ b/lib/src/test_options/group_test_options.dart @@ -24,7 +24,7 @@ class GroupTestOptions { final int? retry; void groupTest(dynamic Function() body) { - dart_test.group( + dart_test.group( description, () { if (setUp != null) { diff --git a/lib/src/test_options/test_options.dart b/lib/src/test_options/test_options.dart index 3af1122..7fb5252 100644 --- a/lib/src/test_options/test_options.dart +++ b/lib/src/test_options/test_options.dart @@ -15,7 +15,7 @@ class TestOptions { final Map? onPlatform; final int? retry; - void test(Object description, dynamic Function() body) { + dynamic test(Object description, dynamic Function() body) async { dart_test.test( description, body, diff --git a/lib/src/test_parameters.dart b/lib/src/test_parameters.dart index 6e8e680..0e364f6 100644 --- a/lib/src/test_parameters.dart +++ b/lib/src/test_parameters.dart @@ -41,7 +41,7 @@ abstract interface class TestParameters { abstract final Function body; abstract final int count; - void mapBody(Iterable values); + dynamic mapBody(Iterable values); } /// Test body class that handles 1 test parameter value. @@ -61,9 +61,9 @@ class TestParameters1 implements TestParameters { final int count = 1; @override - void mapBody(Iterable values) { + dynamic mapBody(Iterable values) { final A1 a1 = castElementAt(values, 0); - body(a1); + return body(a1); } } @@ -84,10 +84,10 @@ class TestParameters2 implements TestParameters { final int count = 2; @override - void mapBody(Iterable values) { + dynamic mapBody(Iterable values) { final A1 a1 = castElementAt(values, 0); final A2 a2 = castElementAt(values, 1); - body(a1, a2); + return body(a1, a2); } } @@ -108,11 +108,11 @@ class TestParameters3 implements TestParameters { final int count = 3; @override - void mapBody(Iterable values) { + dynamic mapBody(Iterable values) { final A1 a1 = castElementAt(values, 0); final A2 a2 = castElementAt(values, 1); final A3 a3 = castElementAt(values, 2); - body(a1, a2, a3); + return body(a1, a2, a3); } } @@ -133,12 +133,12 @@ class TestParameters4 implements TestParameters { final int count = 4; @override - void mapBody(Iterable values) { + dynamic mapBody(Iterable values) { final A1 a1 = castElementAt(values, 0); final A2 a2 = castElementAt(values, 1); final A3 a3 = castElementAt(values, 2); final A4 a4 = castElementAt(values, 3); - body(a1, a2, a3, a4); + return body(a1, a2, a3, a4); } } @@ -159,13 +159,13 @@ class TestParameters5 implements TestParameters { final int count = 5; @override - void mapBody(Iterable values) { + dynamic mapBody(Iterable values) { final A1 a1 = castElementAt(values, 0); final A2 a2 = castElementAt(values, 1); final A3 a3 = castElementAt(values, 2); final A4 a4 = castElementAt(values, 3); final A5 a5 = castElementAt(values, 4); - body(a1, a2, a3, a4, a5); + return body(a1, a2, a3, a4, a5); } } @@ -186,14 +186,14 @@ class TestParameters6 implements TestParameters { final int count = 6; @override - void mapBody(Iterable values) { + dynamic mapBody(Iterable values) { final A1 a1 = castElementAt(values, 0); final A2 a2 = castElementAt(values, 1); final A3 a3 = castElementAt(values, 2); final A4 a4 = castElementAt(values, 3); final A5 a5 = castElementAt(values, 4); final A6 a6 = castElementAt(values, 5); - body(a1, a2, a3, a4, a5, a6); + return body(a1, a2, a3, a4, a5, a6); } } @@ -214,7 +214,7 @@ class TestParameters7 implements TestParameters { final int count = 7; @override - void mapBody(Iterable values) { + dynamic mapBody(Iterable values) { final A1 a1 = castElementAt(values, 0); final A2 a2 = castElementAt(values, 1); final A3 a3 = castElementAt(values, 2); @@ -222,7 +222,7 @@ class TestParameters7 implements TestParameters { final A5 a5 = castElementAt(values, 4); final A6 a6 = castElementAt(values, 5); final A7 a7 = castElementAt(values, 6); - body(a1, a2, a3, a4, a5, a6, a7); + return body(a1, a2, a3, a4, a5, a6, a7); } } @@ -244,7 +244,7 @@ class TestParameters8 final int count = 8; @override - void mapBody(Iterable values) { + dynamic mapBody(Iterable values) { final A1 a1 = castElementAt(values, 0); final A2 a2 = castElementAt(values, 1); final A3 a3 = castElementAt(values, 2); @@ -253,7 +253,7 @@ class TestParameters8 final A6 a6 = castElementAt(values, 5); final A7 a7 = castElementAt(values, 6); final A8 a8 = castElementAt(values, 7); - body(a1, a2, a3, a4, a5, a6, a7, a8); + return body(a1, a2, a3, a4, a5, a6, a7, a8); } } @@ -275,7 +275,7 @@ class TestParameters9 final int count = 9; @override - void mapBody(Iterable values) { + dynamic mapBody(Iterable values) { final A1 a1 = castElementAt(values, 0); final A2 a2 = castElementAt(values, 1); final A3 a3 = castElementAt(values, 2); @@ -285,7 +285,7 @@ class TestParameters9 final A7 a7 = castElementAt(values, 6); final A8 a8 = castElementAt(values, 7); final A9 a9 = castElementAt(values, 8); - body(a1, a2, a3, a4, a5, a6, a7, a8, a9); + return body(a1, a2, a3, a4, a5, a6, a7, a8, a9); } } @@ -307,7 +307,7 @@ class TestParameters10 final int count = 10; @override - void mapBody(Iterable values) { + dynamic mapBody(Iterable values) { final A1 a1 = castElementAt(values, 0); final A2 a2 = castElementAt(values, 1); final A3 a3 = castElementAt(values, 2); @@ -318,6 +318,6 @@ class TestParameters10 final A8 a8 = castElementAt(values, 7); final A9 a9 = castElementAt(values, 8); final A10 a10 = castElementAt(values, 9); - body(a1, a2, a3, a4, a5, a6, a7, a8, a9, a10); + return body(a1, a2, a3, a4, a5, a6, a7, a8, a9, a10); } } diff --git a/lib/src/util/test_value_helpers.dart b/lib/src/util/test_value_helpers.dart index 1817b7e..0825037 100644 --- a/lib/src/util/test_value_helpers.dart +++ b/lib/src/util/test_value_helpers.dart @@ -10,7 +10,7 @@ void mapTests( for (final ValueWithTestOptions value in values) { value.testOptions.test('$value', () { validityCheck(value, length); - body(value.value); + return body(value.value); }); } } @@ -23,7 +23,7 @@ void mapGroups( for (final ValueWithTestOptions value in values) { value.toGroupOptions.groupTest(() { validityCheck(value, length); - body(value.value); + return body(value.value); }); } } diff --git a/lib/src/value_source.dart b/lib/src/value_source.dart index f783246..cad25f4 100644 --- a/lib/src/value_source.dart +++ b/lib/src/value_source.dart @@ -29,7 +29,7 @@ class _ValueSourceImpl implements ValueSource { ) { _groupTestOptions.groupTest(() { mapTests(_values, body.count, (value) { - body.mapBody(value); + return body.mapBody(value); }); }); } @@ -38,7 +38,7 @@ class _ValueSourceImpl implements ValueSource { void executeGroup(TestParameters body) { _groupTestOptions.groupTest(() { mapGroups(_values, body.count, (value) { - body.mapBody(value); + return body.mapBody(value); }); }); } From a15513e37dfb805bac603c9d330cdf823ddedd42 Mon Sep 17 00:00:00 2001 From: Job Guldemeester Date: Fri, 11 Aug 2023 14:14:56 +0200 Subject: [PATCH 4/5] :art: Added group numeric functions --- analysis_options.yaml | 3 - lib/src/parameterized_group_base.dart | 64 ++++ lib/src/parameterized_group_numeric.dart | 380 +++++++++++++++++++++++ lib/src/parameterized_test_base.dart | 60 +--- 4 files changed, 445 insertions(+), 62 deletions(-) create mode 100644 lib/src/parameterized_group_base.dart create mode 100644 lib/src/parameterized_group_numeric.dart diff --git a/analysis_options.yaml b/analysis_options.yaml index f28043c..961d6c0 100644 --- a/analysis_options.yaml +++ b/analysis_options.yaml @@ -13,9 +13,6 @@ analyzer: plugins: - dart_code_metrics - strong-mode: - implicit-casts: false - language: strict-casts: true strict-inference: true diff --git a/lib/src/parameterized_group_base.dart b/lib/src/parameterized_group_base.dart new file mode 100644 index 0000000..fd1a161 --- /dev/null +++ b/lib/src/parameterized_group_base.dart @@ -0,0 +1,64 @@ +import 'package:meta/meta.dart'; +import 'package:test/test.dart'; + +import '../parameterized_test.dart'; +import 'test_options/group_test_options.dart'; +import 'value_source.dart'; + +/// Create a new parameterizedGroup with given [description], [values] and [body] +/// +/// [parameterizedGroup] also have the same options as group tests have. These options will be passed to the group function. +/// +/// For example: +/// ```dart +/// parameterizedGroup( +/// 'Amount of letters', +/// [ +/// ['kiwi', 4], +/// ['apple', 5], +/// ['banana', 6].withTestOptions(skip: 'skip this'), +/// ], +/// p2((String word, int length) { +/// test('test word length',() { +/// expect(word.length, length); +/// }); +/// }), +/// ); +/// ``` +@isTestGroup +void parameterizedGroup( + /// Group description. + Object description, + + /// List of group values. For each values in the list a group test will be executed. + Iterable values, + + /// The test body which is executed for each group value. + /// See [TestParameters] for more info on different bodies. + TestParameters body, { + dynamic Function()? setUp, + + /// Provide a tearDown function to the `group` test. + dynamic Function()? tearDown, + String? testOn, + Timeout? timeout, + dynamic skip, + dynamic tags, + Map? onPlatform, + int? retry, +}) { + ValueSource( + values, + GroupTestOptions( + description: description, + setUp: setUp, + tearDown: tearDown, + testOn: testOn, + timeout: timeout, + skip: skip, + tags: tags, + onPlatform: onPlatform, + retry: retry, + ), + ).executeGroup(body); +} diff --git a/lib/src/parameterized_group_numeric.dart b/lib/src/parameterized_group_numeric.dart new file mode 100644 index 0000000..2a51922 --- /dev/null +++ b/lib/src/parameterized_group_numeric.dart @@ -0,0 +1,380 @@ +import 'package:meta/meta.dart'; +import 'package:test/test.dart'; + +import '../parameterized_test.dart'; +import 'parameterized_group_base.dart'; + +/// Parameterized group with 1 input arguments. See [parameterizedGroup] for more info. +@isTestGroup +void parameterizedGroup1( + /// Group description. + Object description, + + /// List of group values. For each values in the list a group test will be executed. + Iterable values, + + /// The test body which is executed for each group value. + /// See [TestParameters] for more info on different bodies. + dynamic Function(A1) body, { + dynamic Function()? setUp, + + /// Provide a tearDown function to the `group` test. + dynamic Function()? tearDown, + String? testOn, + Timeout? timeout, + dynamic skip, + dynamic tags, + Map? onPlatform, + int? retry, +})=> + parameterizedGroup( + description, + values, + p1(body), + setUp: setUp, + tearDown: tearDown, + testOn: testOn, + timeout: timeout, + skip: skip, + tags: tags, + onPlatform: onPlatform, + retry: retry, + ); + + +/// Parameterized group with 2 input arguments. See [parameterizedGroup] for more info. +@isTestGroup +void parameterizedGroup2( + /// Group description. + Object description, + + /// List of group values. For each values in the list a group test will be executed. + Iterable values, + + /// The test body which is executed for each group value. + /// See [TestParameters] for more info on different bodies. + dynamic Function(A1, A2) body, { + dynamic Function()? setUp, + + /// Provide a tearDown function to the `group` test. + dynamic Function()? tearDown, + String? testOn, + Timeout? timeout, + dynamic skip, + dynamic tags, + Map? onPlatform, + int? retry, +}) => + parameterizedGroup( + description, + values, + p2(body), + setUp: setUp, + tearDown: tearDown, + testOn: testOn, + timeout: timeout, + skip: skip, + tags: tags, + onPlatform: onPlatform, + retry: retry, + ); + +/// Parameterized group with 3 input arguments. See [parameterizedGroup] for more info. +@isTestGroup +void parameterizedGroup3( + /// Group description. + Object description, + + /// List of group values. For each values in the list a group test will be executed. + Iterable values, + + /// The test body which is executed for each group value. + /// See [TestParameters] for more info on different bodies. + dynamic Function(A1, A2, A3) body, { + dynamic Function()? setUp, + + /// Provide a tearDown function to the `group` test. + dynamic Function()? tearDown, + String? testOn, + Timeout? timeout, + dynamic skip, + dynamic tags, + Map? onPlatform, + int? retry, +}) => + parameterizedGroup( + description, + values, + p3(body), + setUp: setUp, + tearDown: tearDown, + testOn: testOn, + timeout: timeout, + skip: skip, + tags: tags, + onPlatform: onPlatform, + retry: retry, + ); + + +/// Parameterized group with 4 input arguments. See [parameterizedGroup] for more info. +@isTestGroup +void parameterizedGroup4( + /// Group description. + Object description, + + /// List of group values. For each values in the list a group test will be executed. + Iterable values, + + /// The test body which is executed for each group value. + /// See [TestParameters] for more info on different bodies. + dynamic Function(A1, A2, A3, A4) body, { + dynamic Function()? setUp, + + /// Provide a tearDown function to the `group` test. + dynamic Function()? tearDown, + String? testOn, + Timeout? timeout, + dynamic skip, + dynamic tags, + Map? onPlatform, + int? retry, +})=> + parameterizedGroup( + description, + values, + p4(body), + setUp: setUp, + tearDown: tearDown, + testOn: testOn, + timeout: timeout, + skip: skip, + tags: tags, + onPlatform: onPlatform, + retry: retry, + ); + + +/// Parameterized group with 5 input arguments. See [parameterizedGroup] for more info. +@isTestGroup +void parameterizedGroup5( + /// Group description. + Object description, + + /// List of group values. For each values in the list a group test will be executed. + Iterable values, + + /// The test body which is executed for each group value. + /// See [TestParameters] for more info on different bodies. + dynamic Function(A1, A2, A3, A4, A5) body, { + dynamic Function()? setUp, + + /// Provide a tearDown function to the `group` test. + dynamic Function()? tearDown, + String? testOn, + Timeout? timeout, + dynamic skip, + dynamic tags, + Map? onPlatform, + int? retry, +}) => + parameterizedGroup( + description, + values, + p5(body), + setUp: setUp, + tearDown: tearDown, + testOn: testOn, + timeout: timeout, + skip: skip, + tags: tags, + onPlatform: onPlatform, + retry: retry, + ); + + +/// Parameterized group with 6 input arguments. See [parameterizedGroup] for more info. +@isTestGroup +void parameterizedGroup6( + /// Group description. + Object description, + + /// List of group values. For each values in the list a group test will be executed. + Iterable values, + + /// The test body which is executed for each group value. + /// See [TestParameters] for more info on different bodies. + dynamic Function(A1, A2, A3, A4, A5, A6) body, { + dynamic Function()? setUp, + + /// Provide a tearDown function to the `group` test. + dynamic Function()? tearDown, + String? testOn, + Timeout? timeout, + dynamic skip, + dynamic tags, + Map? onPlatform, + int? retry, +}) => + parameterizedGroup( + description, + values, + p6(body), + setUp: setUp, + tearDown: tearDown, + testOn: testOn, + timeout: timeout, + skip: skip, + tags: tags, + onPlatform: onPlatform, + retry: retry, + ); + + +/// Parameterized group with 7 input arguments. See [parameterizedGroup] for more info. +@isTestGroup +void parameterizedGroup7( + /// Group description. + Object description, + + /// List of group values. For each values in the list a group test will be executed. + Iterable values, + + /// The test body which is executed for each group value. + /// See [TestParameters] for more info on different bodies. + dynamic Function(A1, A2, A3, A4, A5, A6, A7) body, { + dynamic Function()? setUp, + + /// Provide a tearDown function to the `group` test. + dynamic Function()? tearDown, + String? testOn, + Timeout? timeout, + dynamic skip, + dynamic tags, + Map? onPlatform, + int? retry, +}) => + parameterizedGroup( + description, + values, + p7(body), + setUp: setUp, + tearDown: tearDown, + testOn: testOn, + timeout: timeout, + skip: skip, + tags: tags, + onPlatform: onPlatform, + retry: retry, + ); + +/// Parameterized group with 8 input arguments. See [parameterizedGroup] for more info. +@isTestGroup +void parameterizedGroup8( + /// Group description. + Object description, + + /// List of group values. For each values in the list a group test will be executed. + Iterable values, + + /// The test body which is executed for each group value. + /// See [TestParameters] for more info on different bodies. + dynamic Function(A1, A2, A3, A4, A5, A6, A7, A8) body, { + dynamic Function()? setUp, + + /// Provide a tearDown function to the `group` test. + dynamic Function()? tearDown, + String? testOn, + Timeout? timeout, + dynamic skip, + dynamic tags, + Map? onPlatform, + int? retry, + }) => + parameterizedGroup( + description, + values, + p8(body), + setUp: setUp, + tearDown: tearDown, + testOn: testOn, + timeout: timeout, + skip: skip, + tags: tags, + onPlatform: onPlatform, + retry: retry, + ); + +/// Parameterized group with 9 input arguments. See [parameterizedGroup] for more info. +@isTestGroup +void parameterizedGroup9( + /// Group description. + Object description, + + /// List of group values. For each values in the list a group test will be executed. + Iterable values, + + /// The test body which is executed for each group value. + /// See [TestParameters] for more info on different bodies. + dynamic Function(A1, A2, A3, A4, A5, A6, A7, A8, A9) body, { + dynamic Function()? setUp, + + /// Provide a tearDown function to the `group` test. + dynamic Function()? tearDown, + String? testOn, + Timeout? timeout, + dynamic skip, + dynamic tags, + Map? onPlatform, + int? retry, + }) => + parameterizedGroup( + description, + values, + p9(body), + setUp: setUp, + tearDown: tearDown, + testOn: testOn, + timeout: timeout, + skip: skip, + tags: tags, + onPlatform: onPlatform, + retry: retry, + ); + +/// Parameterized group with 10 input arguments. See [parameterizedGroup] for more info. +@isTestGroup +void parameterizedGroup10( + /// Group description. + Object description, + + /// List of group values. For each values in the list a group test will be executed. + Iterable values, + + /// The test body which is executed for each group value. + /// See [TestParameters] for more info on different bodies. + dynamic Function(A1, A2, A3, A4, A5, A6, A7, A8, A9, A10) body, { + dynamic Function()? setUp, + + /// Provide a tearDown function to the `group` test. + dynamic Function()? tearDown, + String? testOn, + Timeout? timeout, + dynamic skip, + dynamic tags, + Map? onPlatform, + int? retry, + }) => + parameterizedGroup( + description, + values, + p10(body), + setUp: setUp, + tearDown: tearDown, + testOn: testOn, + timeout: timeout, + skip: skip, + tags: tags, + onPlatform: onPlatform, + retry: retry, + ); \ No newline at end of file diff --git a/lib/src/parameterized_test_base.dart b/lib/src/parameterized_test_base.dart index 0236f22..c19a988 100644 --- a/lib/src/parameterized_test_base.dart +++ b/lib/src/parameterized_test_base.dart @@ -59,62 +59,4 @@ void parameterizedTest( retry: retry, ), ).executeTests(body); -} - -/// Create a new parameterizedGroup with given [description], [values] and [body] -/// -/// [parameterizedGroup] also have the same options as group tests have. These options will be passed to the group function. -/// -/// For example: -/// ```dart -/// parameterizedGroup( -/// 'Amount of letters', -/// [ -/// ['kiwi', 4], -/// ['apple', 5], -/// ['banana', 6].withTestOptions(skip: 'skip this'), -/// ], -/// p2((String word, int length) { -/// test('test word length',() { -/// expect(word.length, length); -/// }); -/// }), -/// ); -/// ``` -@isTestGroup -void parameterizedGroup( - /// Group description. - Object description, - - /// List of group values. For each values in the list a group test will be executed. - Iterable values, - - /// The test body which is executed for each group value. - /// See [TestParameters] for more info on different bodies. - TestParameters body, { - dynamic Function()? setUp, - - /// Provide a tearDown function to the `group` test. - dynamic Function()? tearDown, - String? testOn, - Timeout? timeout, - dynamic skip, - dynamic tags, - Map? onPlatform, - int? retry, -}) { - ValueSource( - values, - GroupTestOptions( - description: description, - setUp: setUp, - tearDown: tearDown, - testOn: testOn, - timeout: timeout, - skip: skip, - tags: tags, - onPlatform: onPlatform, - retry: retry, - ), - ).executeGroup(body); -} +} \ No newline at end of file From 0dc232b84012222248f74e885787469fa5b3f693 Mon Sep 17 00:00:00 2001 From: Job Guldemeester Date: Fri, 11 Aug 2023 14:47:07 +0200 Subject: [PATCH 5/5] :art: Added group numeric functions --- lib/src/parameterized_group_numeric.dart | 131 ++++--- lib/src/parameterized_test_base.dart | 2 +- lib/src/parameterized_test_numeric.dart | 362 +++++++++---------- lib/src/test_options/group_test_options.dart | 2 +- 4 files changed, 246 insertions(+), 251 deletions(-) diff --git a/lib/src/parameterized_group_numeric.dart b/lib/src/parameterized_group_numeric.dart index 2a51922..c6b3c8b 100644 --- a/lib/src/parameterized_group_numeric.dart +++ b/lib/src/parameterized_group_numeric.dart @@ -26,7 +26,7 @@ void parameterizedGroup1( dynamic tags, Map? onPlatform, int? retry, -})=> +}) => parameterizedGroup( description, values, @@ -41,7 +41,6 @@ void parameterizedGroup1( retry: retry, ); - /// Parameterized group with 2 input arguments. See [parameterizedGroup] for more info. @isTestGroup void parameterizedGroup2( @@ -116,7 +115,6 @@ void parameterizedGroup3( retry: retry, ); - /// Parameterized group with 4 input arguments. See [parameterizedGroup] for more info. @isTestGroup void parameterizedGroup4( @@ -139,7 +137,7 @@ void parameterizedGroup4( dynamic tags, Map? onPlatform, int? retry, -})=> +}) => parameterizedGroup( description, values, @@ -154,7 +152,6 @@ void parameterizedGroup4( retry: retry, ); - /// Parameterized group with 5 input arguments. See [parameterizedGroup] for more info. @isTestGroup void parameterizedGroup5( @@ -192,7 +189,6 @@ void parameterizedGroup5( retry: retry, ); - /// Parameterized group with 6 input arguments. See [parameterizedGroup] for more info. @isTestGroup void parameterizedGroup6( @@ -230,7 +226,6 @@ void parameterizedGroup6( retry: retry, ); - /// Parameterized group with 7 input arguments. See [parameterizedGroup] for more info. @isTestGroup void parameterizedGroup7( @@ -271,26 +266,26 @@ void parameterizedGroup7( /// Parameterized group with 8 input arguments. See [parameterizedGroup] for more info. @isTestGroup void parameterizedGroup8( - /// Group description. - Object description, - - /// List of group values. For each values in the list a group test will be executed. - Iterable values, - - /// The test body which is executed for each group value. - /// See [TestParameters] for more info on different bodies. - dynamic Function(A1, A2, A3, A4, A5, A6, A7, A8) body, { - dynamic Function()? setUp, - - /// Provide a tearDown function to the `group` test. - dynamic Function()? tearDown, - String? testOn, - Timeout? timeout, - dynamic skip, - dynamic tags, - Map? onPlatform, - int? retry, - }) => + /// Group description. + Object description, + + /// List of group values. For each values in the list a group test will be executed. + Iterable values, + + /// The test body which is executed for each group value. + /// See [TestParameters] for more info on different bodies. + dynamic Function(A1, A2, A3, A4, A5, A6, A7, A8) body, { + dynamic Function()? setUp, + + /// Provide a tearDown function to the `group` test. + dynamic Function()? tearDown, + String? testOn, + Timeout? timeout, + dynamic skip, + dynamic tags, + Map? onPlatform, + int? retry, +}) => parameterizedGroup( description, values, @@ -308,26 +303,26 @@ void parameterizedGroup8( /// Parameterized group with 9 input arguments. See [parameterizedGroup] for more info. @isTestGroup void parameterizedGroup9( - /// Group description. - Object description, - - /// List of group values. For each values in the list a group test will be executed. - Iterable values, - - /// The test body which is executed for each group value. - /// See [TestParameters] for more info on different bodies. - dynamic Function(A1, A2, A3, A4, A5, A6, A7, A8, A9) body, { - dynamic Function()? setUp, - - /// Provide a tearDown function to the `group` test. - dynamic Function()? tearDown, - String? testOn, - Timeout? timeout, - dynamic skip, - dynamic tags, - Map? onPlatform, - int? retry, - }) => + /// Group description. + Object description, + + /// List of group values. For each values in the list a group test will be executed. + Iterable values, + + /// The test body which is executed for each group value. + /// See [TestParameters] for more info on different bodies. + dynamic Function(A1, A2, A3, A4, A5, A6, A7, A8, A9) body, { + dynamic Function()? setUp, + + /// Provide a tearDown function to the `group` test. + dynamic Function()? tearDown, + String? testOn, + Timeout? timeout, + dynamic skip, + dynamic tags, + Map? onPlatform, + int? retry, +}) => parameterizedGroup( description, values, @@ -345,26 +340,26 @@ void parameterizedGroup9( /// Parameterized group with 10 input arguments. See [parameterizedGroup] for more info. @isTestGroup void parameterizedGroup10( - /// Group description. - Object description, - - /// List of group values. For each values in the list a group test will be executed. - Iterable values, - - /// The test body which is executed for each group value. - /// See [TestParameters] for more info on different bodies. - dynamic Function(A1, A2, A3, A4, A5, A6, A7, A8, A9, A10) body, { - dynamic Function()? setUp, - - /// Provide a tearDown function to the `group` test. - dynamic Function()? tearDown, - String? testOn, - Timeout? timeout, - dynamic skip, - dynamic tags, - Map? onPlatform, - int? retry, - }) => + /// Group description. + Object description, + + /// List of group values. For each values in the list a group test will be executed. + Iterable values, + + /// The test body which is executed for each group value. + /// See [TestParameters] for more info on different bodies. + dynamic Function(A1, A2, A3, A4, A5, A6, A7, A8, A9, A10) body, { + dynamic Function()? setUp, + + /// Provide a tearDown function to the `group` test. + dynamic Function()? tearDown, + String? testOn, + Timeout? timeout, + dynamic skip, + dynamic tags, + Map? onPlatform, + int? retry, +}) => parameterizedGroup( description, values, @@ -377,4 +372,4 @@ void parameterizedGroup10( tags: tags, onPlatform: onPlatform, retry: retry, - ); \ No newline at end of file + ); diff --git a/lib/src/parameterized_test_base.dart b/lib/src/parameterized_test_base.dart index c19a988..a1afb97 100644 --- a/lib/src/parameterized_test_base.dart +++ b/lib/src/parameterized_test_base.dart @@ -59,4 +59,4 @@ void parameterizedTest( retry: retry, ), ).executeTests(body); -} \ No newline at end of file +} diff --git a/lib/src/parameterized_test_numeric.dart b/lib/src/parameterized_test_numeric.dart index c15f11e..568747a 100644 --- a/lib/src/parameterized_test_numeric.dart +++ b/lib/src/parameterized_test_numeric.dart @@ -43,26 +43,26 @@ void parameterizedTest1( /// Parameterized test with 2 input arguments. See [parameterizedTest] for more info. @isTestGroup void parameterizedTest2( - /// Test description. - Object description, - - /// List of test values. For each values in the list a test will be executed. - Iterable values, - - /// The test body which is executed for each test value. - /// See [TestParameters] for more info on different bodies. - dynamic Function(A1, A2) body, { - dynamic Function()? setUp, - - /// Provide a tearDown function to the `group` test. - dynamic Function()? tearDown, - String? testOn, - Timeout? timeout, - dynamic skip, - dynamic tags, - Map? onPlatform, - int? retry, - }) => + /// Test description. + Object description, + + /// List of test values. For each values in the list a test will be executed. + Iterable values, + + /// The test body which is executed for each test value. + /// See [TestParameters] for more info on different bodies. + dynamic Function(A1, A2) body, { + dynamic Function()? setUp, + + /// Provide a tearDown function to the `group` test. + dynamic Function()? tearDown, + String? testOn, + Timeout? timeout, + dynamic skip, + dynamic tags, + Map? onPlatform, + int? retry, +}) => parameterizedTest( description, values, @@ -80,26 +80,26 @@ void parameterizedTest2( /// Parameterized test with 3 input arguments. See [parameterizedTest] for more info. @isTestGroup void parameterizedTest3( - /// Test description. - Object description, - - /// List of test values. For each values in the list a test will be executed. - Iterable values, - - /// The test body which is executed for each test value. - /// See [TestParameters] for more info on different bodies. - dynamic Function(A1, A2, A3) body, { - dynamic Function()? setUp, - - /// Provide a tearDown function to the `group` test. - dynamic Function()? tearDown, - String? testOn, - Timeout? timeout, - dynamic skip, - dynamic tags, - Map? onPlatform, - int? retry, - }) => + /// Test description. + Object description, + + /// List of test values. For each values in the list a test will be executed. + Iterable values, + + /// The test body which is executed for each test value. + /// See [TestParameters] for more info on different bodies. + dynamic Function(A1, A2, A3) body, { + dynamic Function()? setUp, + + /// Provide a tearDown function to the `group` test. + dynamic Function()? tearDown, + String? testOn, + Timeout? timeout, + dynamic skip, + dynamic tags, + Map? onPlatform, + int? retry, +}) => parameterizedTest( description, values, @@ -117,26 +117,26 @@ void parameterizedTest3( /// Parameterized test with 4 input arguments. See [parameterizedTest] for more info. @isTestGroup void parameterizedTest4( - /// Test description. - Object description, - - /// List of test values. For each values in the list a test will be executed. - Iterable values, - - /// The test body which is executed for each test value. - /// See [TestParameters] for more info on different bodies. - dynamic Function(A1, A2, A3, A4) body, { - dynamic Function()? setUp, - - /// Provide a tearDown function to the `group` test. - dynamic Function()? tearDown, - String? testOn, - Timeout? timeout, - dynamic skip, - dynamic tags, - Map? onPlatform, - int? retry, - }) => + /// Test description. + Object description, + + /// List of test values. For each values in the list a test will be executed. + Iterable values, + + /// The test body which is executed for each test value. + /// See [TestParameters] for more info on different bodies. + dynamic Function(A1, A2, A3, A4) body, { + dynamic Function()? setUp, + + /// Provide a tearDown function to the `group` test. + dynamic Function()? tearDown, + String? testOn, + Timeout? timeout, + dynamic skip, + dynamic tags, + Map? onPlatform, + int? retry, +}) => parameterizedTest( description, values, @@ -154,26 +154,26 @@ void parameterizedTest4( /// Parameterized test with 5 input arguments. See [parameterizedTest] for more info. @isTestGroup void parameterizedTest5( - /// Test description. - Object description, - - /// List of test values. For each values in the list a test will be executed. - Iterable values, - - /// The test body which is executed for each test value. - /// See [TestParameters] for more info on different bodies. - dynamic Function(A1, A2, A3, A4, A5) body, { - dynamic Function()? setUp, - - /// Provide a tearDown function to the `group` test. - dynamic Function()? tearDown, - String? testOn, - Timeout? timeout, - dynamic skip, - dynamic tags, - Map? onPlatform, - int? retry, - }) => + /// Test description. + Object description, + + /// List of test values. For each values in the list a test will be executed. + Iterable values, + + /// The test body which is executed for each test value. + /// See [TestParameters] for more info on different bodies. + dynamic Function(A1, A2, A3, A4, A5) body, { + dynamic Function()? setUp, + + /// Provide a tearDown function to the `group` test. + dynamic Function()? tearDown, + String? testOn, + Timeout? timeout, + dynamic skip, + dynamic tags, + Map? onPlatform, + int? retry, +}) => parameterizedTest( description, values, @@ -191,26 +191,26 @@ void parameterizedTest5( /// Parameterized test with 6 input arguments. See [parameterizedTest] for more info. @isTestGroup void parameterizedTest6( - /// Test description. - Object description, - - /// List of test values. For each values in the list a test will be executed. - Iterable values, - - /// The test body which is executed for each test value. - /// See [TestParameters] for more info on different bodies. - dynamic Function(A1, A2, A3, A4, A5, A6) body, { - dynamic Function()? setUp, - - /// Provide a tearDown function to the `group` test. - dynamic Function()? tearDown, - String? testOn, - Timeout? timeout, - dynamic skip, - dynamic tags, - Map? onPlatform, - int? retry, - }) => + /// Test description. + Object description, + + /// List of test values. For each values in the list a test will be executed. + Iterable values, + + /// The test body which is executed for each test value. + /// See [TestParameters] for more info on different bodies. + dynamic Function(A1, A2, A3, A4, A5, A6) body, { + dynamic Function()? setUp, + + /// Provide a tearDown function to the `group` test. + dynamic Function()? tearDown, + String? testOn, + Timeout? timeout, + dynamic skip, + dynamic tags, + Map? onPlatform, + int? retry, +}) => parameterizedTest( description, values, @@ -228,26 +228,26 @@ void parameterizedTest6( /// Parameterized test with 7 input arguments. See [parameterizedTest] for more info. @isTestGroup void parameterizedTest7( - /// Test description. - Object description, - - /// List of test values. For each values in the list a test will be executed. - Iterable values, - - /// The test body which is executed for each test value. - /// See [TestParameters] for more info on different bodies. - dynamic Function(A1, A2, A3, A4, A5, A6, A7) body, { - dynamic Function()? setUp, - - /// Provide a tearDown function to the `group` test. - dynamic Function()? tearDown, - String? testOn, - Timeout? timeout, - dynamic skip, - dynamic tags, - Map? onPlatform, - int? retry, - }) => + /// Test description. + Object description, + + /// List of test values. For each values in the list a test will be executed. + Iterable values, + + /// The test body which is executed for each test value. + /// See [TestParameters] for more info on different bodies. + dynamic Function(A1, A2, A3, A4, A5, A6, A7) body, { + dynamic Function()? setUp, + + /// Provide a tearDown function to the `group` test. + dynamic Function()? tearDown, + String? testOn, + Timeout? timeout, + dynamic skip, + dynamic tags, + Map? onPlatform, + int? retry, +}) => parameterizedTest( description, values, @@ -265,26 +265,26 @@ void parameterizedTest7( /// Parameterized test with 8 input arguments. See [parameterizedTest] for more info. @isTestGroup void parameterizedTest8( - /// Test description. - Object description, - - /// List of test values. For each values in the list a test will be executed. - Iterable values, - - /// The test body which is executed for each test value. - /// See [TestParameters] for more info on different bodies. - dynamic Function(A1, A2, A3, A4, A5, A6, A7, A8) body, { - dynamic Function()? setUp, - - /// Provide a tearDown function to the `group` test. - dynamic Function()? tearDown, - String? testOn, - Timeout? timeout, - dynamic skip, - dynamic tags, - Map? onPlatform, - int? retry, - }) => + /// Test description. + Object description, + + /// List of test values. For each values in the list a test will be executed. + Iterable values, + + /// The test body which is executed for each test value. + /// See [TestParameters] for more info on different bodies. + dynamic Function(A1, A2, A3, A4, A5, A6, A7, A8) body, { + dynamic Function()? setUp, + + /// Provide a tearDown function to the `group` test. + dynamic Function()? tearDown, + String? testOn, + Timeout? timeout, + dynamic skip, + dynamic tags, + Map? onPlatform, + int? retry, +}) => parameterizedTest( description, values, @@ -302,26 +302,26 @@ void parameterizedTest8( /// Parameterized test with 9 input arguments. See [parameterizedTest] for more info. @isTestGroup void parameterizedTest9( - /// Test description. - Object description, - - /// List of test values. For each values in the list a test will be executed. - Iterable values, - - /// The test body which is executed for each test value. - /// See [TestParameters] for more info on different bodies. - dynamic Function(A1, A2, A3, A4, A5, A6, A7, A8, A9) body, { - dynamic Function()? setUp, - - /// Provide a tearDown function to the `group` test. - dynamic Function()? tearDown, - String? testOn, - Timeout? timeout, - dynamic skip, - dynamic tags, - Map? onPlatform, - int? retry, - }) => + /// Test description. + Object description, + + /// List of test values. For each values in the list a test will be executed. + Iterable values, + + /// The test body which is executed for each test value. + /// See [TestParameters] for more info on different bodies. + dynamic Function(A1, A2, A3, A4, A5, A6, A7, A8, A9) body, { + dynamic Function()? setUp, + + /// Provide a tearDown function to the `group` test. + dynamic Function()? tearDown, + String? testOn, + Timeout? timeout, + dynamic skip, + dynamic tags, + Map? onPlatform, + int? retry, +}) => parameterizedTest( description, values, @@ -339,26 +339,26 @@ void parameterizedTest9( /// Parameterized test with 10 input arguments. See [parameterizedTest] for more info. @isTestGroup void parameterizedTest10( - /// Test description. - Object description, - - /// List of test values. For each values in the list a test will be executed. - Iterable values, - - /// The test body which is executed for each test value. - /// See [TestParameters] for more info on different bodies. - dynamic Function(A1, A2, A3, A4, A5, A6, A7, A8, A9, A10) body, { - dynamic Function()? setUp, - - /// Provide a tearDown function to the `group` test. - dynamic Function()? tearDown, - String? testOn, - Timeout? timeout, - dynamic skip, - dynamic tags, - Map? onPlatform, - int? retry, - }) => + /// Test description. + Object description, + + /// List of test values. For each values in the list a test will be executed. + Iterable values, + + /// The test body which is executed for each test value. + /// See [TestParameters] for more info on different bodies. + dynamic Function(A1, A2, A3, A4, A5, A6, A7, A8, A9, A10) body, { + dynamic Function()? setUp, + + /// Provide a tearDown function to the `group` test. + dynamic Function()? tearDown, + String? testOn, + Timeout? timeout, + dynamic skip, + dynamic tags, + Map? onPlatform, + int? retry, +}) => parameterizedTest( description, values, @@ -371,4 +371,4 @@ void parameterizedTest10( tags: tags, onPlatform: onPlatform, retry: retry, - ); \ No newline at end of file + ); diff --git a/lib/src/test_options/group_test_options.dart b/lib/src/test_options/group_test_options.dart index 1ebffe4..a11a5fb 100644 --- a/lib/src/test_options/group_test_options.dart +++ b/lib/src/test_options/group_test_options.dart @@ -24,7 +24,7 @@ class GroupTestOptions { final int? retry; void groupTest(dynamic Function() body) { - dart_test.group( + dart_test.group( description, () { if (setUp != null) {