Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1648)

Unified Diff: pkg/unittest/test/unittest_expect_async_args_test.dart

Issue 187323003: pkg/unittest: much cleaner support for arbitrary args in expectAsync functions (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: fixed status Created 6 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: pkg/unittest/test/unittest_expect_async_args_test.dart
diff --git a/pkg/unittest/test/unittest_completion_test.dart b/pkg/unittest/test/unittest_expect_async_args_test.dart
similarity index 51%
copy from pkg/unittest/test/unittest_completion_test.dart
copy to pkg/unittest/test/unittest_expect_async_args_test.dart
index 843f9d06b2155db2b314659d40725339ad2c8362..355fce50278dd81f880fc7a4a1714f0fc27d07b4 100644
--- a/pkg/unittest/test/unittest_completion_test.dart
+++ b/pkg/unittest/test/unittest_expect_async_args_test.dart
@@ -3,25 +3,26 @@
// BSD-style license that can be found in the LICENSE file.
library unittestTest;
+
import 'dart:isolate';
import 'dart:async';
import 'package:unittest/unittest.dart';
part 'unittest_test_utils.dart';
-var testName = 'completion test';
+var testName = 'expect async args';
var testFunction = (TestConfiguration testConfig) {
+ List<int> _getArgs([a = 0, b = 0, c = 0, d = 0, e = 0, f = 0]) {
+ testConfig.count++;
+ return [a, b, c, d, e, f];
+ }
+
test(testName, () {
- var _callback;
- _callback = expectAsyncUntil0(() {
- if (++testConfig.count < 10) {
- _defer(_callback);
- }
- },
- () => (testConfig.count == 10));
- _defer(_callback);
+ expect(expectAsync(_getArgs)(), [0, 0, 0, 0, 0, 0]);
+ expect(expectAsync(_getArgs)(5), [5, 0, 0, 0, 0, 0]);
+ expect(expectAsync(_getArgs)(1, 2, 3, 4, 5, 6), [1, 2, 3, 4, 5, 6]);
Siggi Cherem (dart-lang) 2014/03/05 19:09:18 what happens if you call it with 7 args (one more
kevmoo 2014/03/05 21:41:26 I added a test for too many args passed and provid
});
};
-var expected = buildStatusString(1, 0, 0, testName, count: 10);
+var expected = buildStatusString(1, 0, 0, testName, count: 3);
« no previous file with comments | « pkg/unittest/test/unittest_excess_callback_test.dart ('k') | pkg/unittest/test/unittest_late_exception_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698