Chromium Code Reviews| 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); |