diff --git a/LibTest/async/Completer/completeError_A01_t01.dart b/LibTest/async/Completer/completeError_A01_t01.dart index b0860d2d83..fdcc2f8ec1 100644 --- a/LibTest/async/Completer/completeError_A01_t01.dart +++ b/LibTest/async/Completer/completeError_A01_t01.dart @@ -34,11 +34,14 @@ check(value) { } main() { + asyncStart(); check(0); check(-5); - //check(null); // null is disallowed as an argument to completeError() check('string'); check(true); check(const {'k1': 1, 'k2': 2}); - Future.wait(futures).whenComplete(() => Expect.equals(5, count)); + Future.wait(futures).whenComplete(() { + Expect.equals(5, count); + asyncEnd(); + }); } diff --git a/LibTest/async/Completer/completeError_A01_t02.dart b/LibTest/async/Completer/completeError_A01_t02.dart index cd42470c13..e02b6f7242 100644 --- a/LibTest/async/Completer/completeError_A01_t02.dart +++ b/LibTest/async/Completer/completeError_A01_t02.dart @@ -15,26 +15,20 @@ import "dart:async"; main() { var completer = new Completer(); var future = completer.future; - var error = new Error(); var stackTrace; asyncStart(); - try { throw error; - } catch(e, st) { + } catch (e, st) { stackTrace = st; completer.completeError(e, st); } - future.then( - (fValue) => Expect.fail('should not get here'), - onError:(e, st) { - Expect.identical(error, e); - Expect.identical(stackTrace, st); - asyncEnd(); - } - ); + future.then((fValue) => Expect.fail('should not get here'), onError: (e, st) { + Expect.identical(error, e); + Expect.identical(stackTrace, st); + asyncEnd(); + }); } - diff --git a/LibTest/async/Completer/completeError_A01_t03.dart b/LibTest/async/Completer/completeError_A01_t03.dart index 31add756d9..5c52d447fd 100644 --- a/LibTest/async/Completer/completeError_A01_t03.dart +++ b/LibTest/async/Completer/completeError_A01_t03.dart @@ -16,21 +16,16 @@ import "dart:async"; main() { var completer = new Completer(); var future = completer.future; - - var v = [1,2,3]; + var v = [1, 2, 3]; asyncStart(2); - var f = new Future.value(v).then((x) { asyncEnd(); return x; }); - - future - .catchError((e) { - Expect.identical(f, e); - asyncEnd(); - }); - + future.catchError((e) { + Expect.identical(f, e); + asyncEnd(); + }); completer.completeError(f); } diff --git a/LibTest/async/Completer/completeError_A01_t04.dart b/LibTest/async/Completer/completeError_A01_t04.dart index 5e4bd305ce..33957f2675 100644 --- a/LibTest/async/Completer/completeError_A01_t04.dart +++ b/LibTest/async/Completer/completeError_A01_t04.dart @@ -16,21 +16,16 @@ import "dart:async"; main() { var completer = new Completer(); var future = completer.future; - var e = new Error(); asyncStart(2); - var f = new Future.error(e).catchError((x) { asyncEnd(); return x; }); - - future - .catchError((e) { - Expect.identical(f, e); - asyncEnd(); - }); - + future.catchError((e) { + Expect.identical(f, e); + asyncEnd(); + }); completer.completeError(f); } diff --git a/LibTest/async/Completer/completeError_A02_t01.dart b/LibTest/async/Completer/completeError_A02_t01.dart deleted file mode 100644 index fb5c633338..0000000000 --- a/LibTest/async/Completer/completeError_A02_t01.dart +++ /dev/null @@ -1,18 +0,0 @@ -// Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file -// for details. All rights reserved. Use of this source code is governed by a -// BSD-style license that can be found in the LICENSE file. - -/// @assertion void completeError(Object exception, [Object stackTrace]) -/// The error must not be null. -/// @description Checks that the error must not be null. -/// @author ilya - -import "dart:async"; - -main() { - var completer = new Completer(); - completer.completeError(null); -// ^^^^ -// [analyzer] unspecified -// [cfe] unspecified -} diff --git a/LibTest/async/Completer/complete_A01_t01.dart b/LibTest/async/Completer/complete_A01_t01.dart index cb8b00dc07..9f5c0c9a56 100644 --- a/LibTest/async/Completer/complete_A01_t01.dart +++ b/LibTest/async/Completer/complete_A01_t01.dart @@ -31,10 +31,12 @@ check(value) { } main() { + asyncStart(); check(0); check(-5); check(null); check('string'); check(true); check(const {'k1': 1, 'k2': 2}); + asyncEnd(); } diff --git a/LibTest/async/Completer/complete_A01_t04.dart b/LibTest/async/Completer/complete_A01_t04.dart index a016f12b9f..29d311f1d1 100644 --- a/LibTest/async/Completer/complete_A01_t04.dart +++ b/LibTest/async/Completer/complete_A01_t04.dart @@ -24,6 +24,7 @@ main() { var completer = new Completer(); var future = completer.future; + asyncStart(); for (int k = 0; k < N; k++) { asyncStart(); futures.add(future.then((fValue) { @@ -32,7 +33,9 @@ main() { asyncEnd(); })); } - Future.wait(futures).whenComplete(() => Expect.equals(N, count)); - + Future.wait(futures).whenComplete(() { + Expect.equals(N, count); + asyncEnd(); + }); completer.complete(v); } diff --git a/LibTest/async/Completer/complete_A01_t05.dart b/LibTest/async/Completer/complete_A01_t05.dart index 92aaf291f4..1b6b3f567f 100644 --- a/LibTest/async/Completer/complete_A01_t05.dart +++ b/LibTest/async/Completer/complete_A01_t05.dart @@ -19,15 +19,12 @@ import "../../../Utils/expect.dart"; main() { var completer = new Completer(); var future = completer.future; - var value = [1, 2, 3]; asyncStart(); - future.then((x) { Expect.identical(value, x); asyncEnd(); }); - completer.complete(new Future.value(value)); } diff --git a/LibTest/async/Completer/complete_A01_t06.dart b/LibTest/async/Completer/complete_A01_t06.dart index 5b297bd2ac..425e9929c8 100644 --- a/LibTest/async/Completer/complete_A01_t06.dart +++ b/LibTest/async/Completer/complete_A01_t06.dart @@ -19,15 +19,12 @@ import "../../../Utils/expect.dart"; main() { var completer = new Completer(); var future = completer.future; - var error = new Error(); asyncStart(); - future.catchError((x) { Expect.identical(error, x); asyncEnd(); }); - completer.complete(new Future.error(error)); } diff --git a/LibTest/async/DeferredLibrary/DeferredLibrary_A01_t01.dart b/LibTest/async/DeferredLibrary/DeferredLibrary_A01_t01.dart index 31a81b3388..e9b4863ac8 100644 --- a/LibTest/async/DeferredLibrary/DeferredLibrary_A01_t01.dart +++ b/LibTest/async/DeferredLibrary/DeferredLibrary_A01_t01.dart @@ -9,7 +9,6 @@ /// @author kaigorodov /// @todo move from LibTest to Language - import "../../../Utils/expect.dart"; import 'DeferredLibrary_A01_t01.lib.dart' deferred as lazy; @@ -17,8 +16,7 @@ import 'DeferredLibrary_A01_t01.lib.dart' deferred as lazy; void main() { try { lazy.method(); // foo is not loaded yet. -// Expect.fail("NoSuchMethodError expected"); -- #11507: do not insist on lazy loading - } on NoSuchMethodError catch(ok) { + } on NoSuchMethodError catch(_) { } asyncStart(); lazy.loadLibrary().then(onFooLoaded); diff --git a/LibTest/async/EventSink/all_tests.lib.dart b/LibTest/async/EventSink/all_tests.lib.dart index 7601d59e85..d999c86f91 100644 --- a/LibTest/async/EventSink/all_tests.lib.dart +++ b/LibTest/async/EventSink/all_tests.lib.dart @@ -11,6 +11,7 @@ library all_tests_eventsink; import "dart:async"; +import "../../../Utils/expect.dart"; import "EventSink_A01_t01.test.dart" as EventSink_A01_t01; import "hashCode_A01_t01.test.dart" as hashCode_A01_t01; import "runtimeType_A01_t01.test.dart" as runtimeType_A01_t01; @@ -22,6 +23,7 @@ import "noSuchMethodError_A01_t01.test.dart" as noSuchMethodError_A01_t01; import "toString_A01_t01.test.dart" as toString_A01_t01; test(EventSink create()) { + asyncStart(); EventSink_A01_t01.test(create); hashCode_A01_t01.test(create); runtimeType_A01_t01.test(create); @@ -31,4 +33,5 @@ test(EventSink create()) { close_A01_t01.test(create); noSuchMethodError_A01_t01.test(create); toString_A01_t01.test(create); + asyncEnd(); } diff --git a/LibTest/async/Future/Future.delayed_A01_t01.dart b/LibTest/async/Future/Future.delayed_A01_t01.dart index d181ab397c..f1c9739d52 100644 --- a/LibTest/async/Future/Future.delayed_A01_t01.dart +++ b/LibTest/async/Future/Future.delayed_A01_t01.dart @@ -24,6 +24,7 @@ void check(delay, value) { } main() { + asyncStart(); check(0, 0); check(10, 1); check(0, -5); @@ -33,4 +34,5 @@ main() { check(0, true); check(10, const []); check(0, const {'k1': 1, 'k2': 2}); + asyncEnd(); } diff --git a/LibTest/async/Future/Future.delayed_A01_t02.dart b/LibTest/async/Future/Future.delayed_A01_t02.dart index 06b725528a..7976aeaae1 100644 --- a/LibTest/async/Future/Future.delayed_A01_t02.dart +++ b/LibTest/async/Future/Future.delayed_A01_t02.dart @@ -36,9 +36,11 @@ check(delayms) { } main() { + asyncStart(); check(0); check(30); check(50); check(100); check(150); + asyncEnd(); } diff --git a/LibTest/async/Future/Future.delayed_A03_t01.dart b/LibTest/async/Future/Future.delayed_A03_t01.dart index 0e8bdf8da5..e3c02f47a6 100644 --- a/LibTest/async/Future/Future.delayed_A03_t01.dart +++ b/LibTest/async/Future/Future.delayed_A03_t01.dart @@ -27,7 +27,9 @@ check(delay, value) { } main() { + asyncStart(); check(100, 3); check(50, ''); check(0, []); + asyncEnd(); } diff --git a/LibTest/async/Future/Future.error_A01_t01.dart b/LibTest/async/Future/Future.error_A01_t01.dart index 98be423097..deada1ab7b 100644 --- a/LibTest/async/Future/Future.error_A01_t01.dart +++ b/LibTest/async/Future/Future.error_A01_t01.dart @@ -27,6 +27,7 @@ check(value) { } main() { + asyncStart(); check(0); check(1); check(-5); @@ -35,4 +36,5 @@ main() { check(true); check(const []); check(const {'k1': 1, 'k2': 2}); + asyncEnd(); } diff --git a/LibTest/async/Future/Future.sync_A01_t01.dart b/LibTest/async/Future/Future.sync_A01_t01.dart index c65bf96e02..28a7155bb3 100644 --- a/LibTest/async/Future/Future.sync_A01_t01.dart +++ b/LibTest/async/Future/Future.sync_A01_t01.dart @@ -29,6 +29,7 @@ check(value) { } main() { + asyncStart(); check(0); check(1); check(-5); @@ -38,4 +39,5 @@ main() { check(true); check(const []); check(const {'k1': 1, 'k2': 2}); + asyncEnd(); } diff --git a/LibTest/async/Future/Future.sync_A01_t03.dart b/LibTest/async/Future/Future.sync_A01_t03.dart index c14b3a4df9..21db3c49b6 100644 --- a/LibTest/async/Future/Future.sync_A01_t03.dart +++ b/LibTest/async/Future/Future.sync_A01_t03.dart @@ -37,6 +37,7 @@ check(value) { } main() { + asyncStart(); check(0); check(1); check(-5); @@ -46,4 +47,5 @@ main() { check(true); check(const []); check(const {'k1': 1, 'k2': 2}); + asyncEnd(); } diff --git a/LibTest/async/Future/Future.value_A01_t01.dart b/LibTest/async/Future/Future.value_A01_t01.dart index 24b1d690e2..ecce9dea95 100644 --- a/LibTest/async/Future/Future.value_A01_t01.dart +++ b/LibTest/async/Future/Future.value_A01_t01.dart @@ -24,6 +24,7 @@ check(value) { } main() { + asyncStart(); check(0); check(1); check(-5); @@ -33,4 +34,5 @@ main() { check(true); check(const []); check(const {'k1': 1, 'k2': 2}); + asyncEnd(); } diff --git a/LibTest/async/Future/any_A01_t01.dart b/LibTest/async/Future/any_A01_t01.dart index 74a62cbbce..70fca776b3 100644 --- a/LibTest/async/Future/any_A01_t01.dart +++ b/LibTest/async/Future/any_A01_t01.dart @@ -41,7 +41,6 @@ main() { c.complete(null); } } - Future f = Future.any(futures); asyncStart(); diff --git a/LibTest/async/Future/any_A01_t03.dart b/LibTest/async/Future/any_A01_t03.dart index 1d68d559c3..7721e07fb9 100644 --- a/LibTest/async/Future/any_A01_t03.dart +++ b/LibTest/async/Future/any_A01_t03.dart @@ -41,7 +41,6 @@ main() { c.complete(true); } } - Future f = Future.any(futures); asyncStart(); diff --git a/LibTest/async/Future/any_A01_t04.dart b/LibTest/async/Future/any_A01_t04.dart index bf90fc990f..2d24b2bfe8 100644 --- a/LibTest/async/Future/any_A01_t04.dart +++ b/LibTest/async/Future/any_A01_t04.dart @@ -38,7 +38,6 @@ main() { c.complete(true); } } - Future f = Future.any(futures); asyncStart(); diff --git a/LibTest/async/Future/asStream_A01_t01.dart b/LibTest/async/Future/asStream_A01_t01.dart index 013389c62b..5d5390d791 100644 --- a/LibTest/async/Future/asStream_A01_t01.dart +++ b/LibTest/async/Future/asStream_A01_t01.dart @@ -25,6 +25,7 @@ check(var value) { } main() { + asyncStart(); check(0); check(1); check(-5); @@ -34,4 +35,5 @@ main() { check(true); check(const []); check(const {'k1': 1, 'k2': 2}); + asyncEnd(); } diff --git a/LibTest/async/Future/catchError_A02_t01.dart b/LibTest/async/Future/catchError_A02_t01.dart index 34317d48cd..2869361ea6 100644 --- a/LibTest/async/Future/catchError_A02_t01.dart +++ b/LibTest/async/Future/catchError_A02_t01.dart @@ -17,25 +17,23 @@ check(value) { Future f = completer.future; asyncStart(); - f.catchError( - (Object error) { - Expect.fail("onError should not be called"); - } - ).then( - (x) { - Expect.identical(value, x); - asyncEnd(); - } - ); + f.catchError((Object error) { + Expect.fail("onError should not be called"); + }).then((x) { + Expect.identical(value, x); + asyncEnd(); + }); completer.complete(value); } main() { + asyncStart(); check(0); check(''); check(false); check([]); check(new Object()); check(new Exception()); + asyncEnd(); } diff --git a/LibTest/async/Future/catchError_A02_t02.dart b/LibTest/async/Future/catchError_A02_t02.dart index 51bc1f2a2f..c40bd6f3cd 100644 --- a/LibTest/async/Future/catchError_A02_t02.dart +++ b/LibTest/async/Future/catchError_A02_t02.dart @@ -17,29 +17,26 @@ check(value) { Future f = completer.future; asyncStart(); - f.catchError( - (Object error) { - Expect.fail("onError should not be called"); - }, - test: (Object error){ - Expect.fail("test should not be called"); - return false; - } - ).then( - (x) { - Expect.identical(value, x); - asyncEnd(); - } - ); + f.catchError((Object error) { + Expect.fail("onError should not be called"); + }, test: (Object error) { + Expect.fail("test should not be called"); + return false; + }).then((x) { + Expect.identical(value, x); + asyncEnd(); + }); completer.complete(value); } main() { + asyncStart(); check(0); check(''); check(false); check([]); check(new Object()); check(new Exception()); + asyncEnd(); } diff --git a/LibTest/async/Future/catchError_A02_t03.dart b/LibTest/async/Future/catchError_A02_t03.dart index e6dfc9015f..cdb9122753 100644 --- a/LibTest/async/Future/catchError_A02_t03.dart +++ b/LibTest/async/Future/catchError_A02_t03.dart @@ -18,29 +18,26 @@ check(value) { Future f = completer.future; asyncStart(); - f.catchError( - (Object error, StackTrace stackTrace) { - Expect.fail("onError should not be called"); - }, - test: (Object error){ - Expect.fail("test should not be called"); - return false; - } - ).then( - (x) { - Expect.identical(value, x); - asyncEnd(); - } - ); + f.catchError((Object error, StackTrace stackTrace) { + Expect.fail("onError should not be called"); + }, test: (Object error) { + Expect.fail("test should not be called"); + return false; + }).then((x) { + Expect.identical(value, x); + asyncEnd(); + }); completer.complete(value); } main() { + asyncStart(); check(0); check(''); check(false); check([]); check(new Object()); check(new Exception()); + asyncEnd(); } diff --git a/LibTest/async/Future/catchError_A06_t01.dart b/LibTest/async/Future/catchError_A06_t01.dart index 818f5a6b32..6aff9bf05c 100644 --- a/LibTest/async/Future/catchError_A06_t01.dart +++ b/LibTest/async/Future/catchError_A06_t01.dart @@ -46,8 +46,10 @@ check(value) { } main() { + asyncStart(); check(1); check(''); check({}); check(false); + asyncEnd(); } diff --git a/LibTest/async/Future/forEach_A01_t01.dart b/LibTest/async/Future/forEach_A01_t01.dart index 8eac6562c0..df05bfb794 100644 --- a/LibTest/async/Future/forEach_A01_t01.dart +++ b/LibTest/async/Future/forEach_A01_t01.dart @@ -29,9 +29,10 @@ void check(List input) { } main() { + asyncStart(); check([0, 1, 2, 3, 4]); check(["a", "b", "c", "d"]); check([]); check([0, null, "a", 3.14, true, false]); + asyncEnd(); } - diff --git a/LibTest/async/Future/forEach_A01_t02.dart b/LibTest/async/Future/forEach_A01_t02.dart index ec833cd7c0..19d484e75e 100644 --- a/LibTest/async/Future/forEach_A01_t02.dart +++ b/LibTest/async/Future/forEach_A01_t02.dart @@ -35,8 +35,10 @@ void check(List input) { } main() { + asyncStart(); check([0, 1, 2, 3, 4]); check(["a", "b", "c", "d"]); check([]); check([0, null, "a", 3.14, true, false]); + asyncEnd(); } diff --git a/LibTest/async/Future/forEach_A01_t03.dart b/LibTest/async/Future/forEach_A01_t03.dart index 97c805f73b..c09ba99d70 100644 --- a/LibTest/async/Future/forEach_A01_t03.dart +++ b/LibTest/async/Future/forEach_A01_t03.dart @@ -31,8 +31,10 @@ void check(List input) { } main() { + asyncStart(); check([0, 1, 2, 3, 4]); check(["a", "b", "c", "d"]); check([]); check([0, null, "a", 3.14, true, false]); + asyncEnd(); } diff --git a/LibTest/async/Future/forEach_A02_t01.dart b/LibTest/async/Future/forEach_A02_t01.dart index c552d7f2dc..53d6ee38d6 100644 --- a/LibTest/async/Future/forEach_A02_t01.dart +++ b/LibTest/async/Future/forEach_A02_t01.dart @@ -31,8 +31,10 @@ void check(List input){ } main() { + asyncStart(); check([0, 1, 2, 3, 4]); check(["a", "b", "c", "d"]); check([]); check([0, null, "a", 3.14, true, false]); + asyncEnd(); } diff --git a/LibTest/async/Future/then_A01_t01.dart b/LibTest/async/Future/then_A01_t01.dart index 6ad04b9620..8c5d69284e 100644 --- a/LibTest/async/Future/then_A01_t01.dart +++ b/LibTest/async/Future/then_A01_t01.dart @@ -31,10 +31,12 @@ void check(Object value) { } main() { + asyncStart(); check(0); check(''); check(false); check([]); check(new Object()); check(new Exception()); + asyncEnd(); } diff --git a/LibTest/async/Future/then_A01_t02.dart b/LibTest/async/Future/then_A01_t02.dart index 7235379e7f..4247bce582 100644 --- a/LibTest/async/Future/then_A01_t02.dart +++ b/LibTest/async/Future/then_A01_t02.dart @@ -34,9 +34,11 @@ void check(Object value) { } main() { + asyncStart(); check(1e98); check('value'); check(true); check(const {}); check(const C()); + asyncEnd(); } diff --git a/LibTest/async/Future/then_A03_t01.dart b/LibTest/async/Future/then_A03_t01.dart index 2c7b931901..29ada75296 100644 --- a/LibTest/async/Future/then_A03_t01.dart +++ b/LibTest/async/Future/then_A03_t01.dart @@ -27,8 +27,10 @@ check(Object value) { } main() { + asyncStart(); check("0"); check(20); check(3.14); check(new Object()); + asyncEnd(); } diff --git a/LibTest/async/Future/then_A04_t01.dart b/LibTest/async/Future/then_A04_t01.dart index 4cd954413a..ab4dea70fd 100644 --- a/LibTest/async/Future/then_A04_t01.dart +++ b/LibTest/async/Future/then_A04_t01.dart @@ -31,8 +31,10 @@ void check(Object value) { } main() { - check("0"); - check(20); - check(3.14); - check(new Error()); + asyncStart(); + check("0"); + check(20); + check(3.14); + check(new Error()); + asyncEnd(); } diff --git a/LibTest/async/Future/timeout_A01_t01.dart b/LibTest/async/Future/timeout_A01_t01.dart index 13173e5676..c53acfc6ff 100644 --- a/LibTest/async/Future/timeout_A01_t01.dart +++ b/LibTest/async/Future/timeout_A01_t01.dart @@ -27,6 +27,7 @@ check(var value) { } main() { + asyncStart(); check(0); check(1); check(-5); @@ -36,4 +37,5 @@ main() { check(true); check(const []); check(const {'k1': 1, 'k2': 2}); + asyncEnd(); } diff --git a/LibTest/async/Future/wait_A02_t01.dart b/LibTest/async/Future/wait_A02_t01.dart index 71f720968a..1229c5616d 100644 --- a/LibTest/async/Future/wait_A02_t01.dart +++ b/LibTest/async/Future/wait_A02_t01.dart @@ -33,7 +33,6 @@ main() { f.then( (value) { Expect.fail("Returned future should complete with error"); - asyncEnd(); }, onError: (error) { Expect.isTrue([1, 2, 3, 4, 5].contains(error), "error: $error"); diff --git a/LibTest/async/Future/wait_A02_t02.dart b/LibTest/async/Future/wait_A02_t02.dart index 1e3aa6e24a..a2bb0b5717 100644 --- a/LibTest/async/Future/wait_A02_t02.dart +++ b/LibTest/async/Future/wait_A02_t02.dart @@ -34,7 +34,6 @@ main() { f.then( (value) { Expect.fail("Returned future should complete with error"); - asyncEnd(); }, onError: (Object error) { Expect.equals(1, error); diff --git a/LibTest/async/Future/wait_A03_t01.dart b/LibTest/async/Future/wait_A03_t01.dart index c12f53ba13..f897ae386e 100644 --- a/LibTest/async/Future/wait_A03_t01.dart +++ b/LibTest/async/Future/wait_A03_t01.dart @@ -37,7 +37,6 @@ main() { f.then( (value) { Expect.fail("Returned future should complete with error"); - asyncEnd(); }, onError: (Object error) { Expect.equals(2, error); diff --git a/LibTest/async/Stream/allTests_A01.lib.dart b/LibTest/async/Stream/allTests_A01.lib.dart index 675e4b1628..82a6d64b2c 100644 --- a/LibTest/async/Stream/allTests_A01.lib.dart +++ b/LibTest/async/Stream/allTests_A01.lib.dart @@ -34,7 +34,6 @@ import "asyncMap_A01_t04.test.dart" as asyncMap_A01_t04; import "asyncMap_A02_t01.test.dart" as asyncMap_A02_t01; import "asyncMap_A03_t02.test.dart" as asyncMap_A03_t02; import "asyncMap_A03_t03.test.dart" as asyncMap_A03_t03; -import "asyncMap_A04_t01.test.dart" as asyncMap_A04_t01; import "contains_A01_t01.test.dart" as contains_A01_t01; import "contains_A02_t01.test.dart" as contains_A02_t01; @@ -161,6 +160,7 @@ import "transform_A01_t02.test.dart" as transform_A01_t02; import "where_A01_t01.test.dart" as where_A01_t01; void test(CreateStreamFunction create) { + asyncStart(); any_A01_t01.test(create); any_A01_t02.test(create); @@ -186,7 +186,6 @@ void test(CreateStreamFunction create) { asyncMap_A02_t01.test(create); asyncMap_A03_t02.test(create); asyncMap_A03_t03.test(create); -// asyncMap_A04_t01.test(create); // fails with error, moved to allTests_A03 contains_A01_t01.test(create); contains_A02_t01.test(create); @@ -310,4 +309,5 @@ void test(CreateStreamFunction create) { transform_A01_t02.test(create); where_A01_t01.test(create); + asyncEnd(); } diff --git a/LibTest/async/Stream/allTests_A02.lib.dart b/LibTest/async/Stream/allTests_A02.lib.dart index 2bc8bee2e9..c661969d0e 100644 --- a/LibTest/async/Stream/allTests_A02.lib.dart +++ b/LibTest/async/Stream/allTests_A02.lib.dart @@ -76,6 +76,7 @@ import "transform_A01_t01.test.dart" as transform_A01_t01; import "where_A01_t02.test.dart" as where_A01_t02; void test(CreateStreamWithErrorsFunction create) { + asyncStart(); any_A02_t01.test(create); asBroadcastStream_A05_t02.test(create); @@ -141,4 +142,5 @@ void test(CreateStreamWithErrorsFunction create) { transform_A01_t01.test(create); where_A01_t02.test(create); + asyncEnd(); } diff --git a/LibTest/async/Stream/allTests_A03.lib.dart b/LibTest/async/Stream/allTests_A03.lib.dart index 5c7b1faf91..cb14a88005 100644 --- a/LibTest/async/Stream/allTests_A03.lib.dart +++ b/LibTest/async/Stream/allTests_A03.lib.dart @@ -14,7 +14,9 @@ import "asBroadcastStream_A05_t03.test.dart" as asBroadcastStream_A05_t03; import "asyncMap_A04_t01.test.dart" as asyncMap_A04_t01; void test(CreateStreamFunction create) { + asyncStart(); asBroadcastStream_A05_t03.test(create); // failures TODO move in place when fixed asyncMap_A04_t01.test(create); // issue #29615 + asyncEnd(); } diff --git a/LibTest/async/Stream/distinct_A03_t01.test.dart b/LibTest/async/Stream/distinct_A03_t01.test.dart index 1fc50eece2..eb0a70283b 100644 --- a/LibTest/async/Stream/distinct_A03_t01.test.dart +++ b/LibTest/async/Stream/distinct_A03_t01.test.dart @@ -50,7 +50,6 @@ void check(Stream s) { Map, int> equalsLog = new Map, int>(); bool equals(T p, T n) { - // print("equals($p,$n)"); Key key = new Key(p,n); equalsLog[key] = 1 + equalsLog.putIfAbsent(key, () => 0); return p==n; @@ -64,14 +63,11 @@ void check(Stream s) { subscribe(d) ]).then( (List> result) { - // print(equalsLog); - // result.forEach(print); result.forEach((received) => Expect.listEquals(result[0], received)); equalsLog.values.forEach((v) => Expect.equals(3, v)); asyncEnd(); } ); - } void test(CreateStreamFunction create) { @@ -79,6 +75,4 @@ void test(CreateStreamFunction create) { check(create([1, 2, 4, 3])); check(create([1, 2, 2, 3])); check(create(["a", "b", null, null])); -// check(create(new Iterable.generate(5, (int index) => 1))); -// check(create(new Iterable.generate(10, (int index) => [0]))); } diff --git a/LibTest/async/StreamConsumer/all_tests.lib.dart b/LibTest/async/StreamConsumer/all_tests.lib.dart index e8a4e82cf6..60ce6d6a8c 100644 --- a/LibTest/async/StreamConsumer/all_tests.lib.dart +++ b/LibTest/async/StreamConsumer/all_tests.lib.dart @@ -12,6 +12,7 @@ library all_tests_streamconsumer; import "dart:async"; +import "../../../Utils/expect.dart"; import "StreamConsumer_A01_t01.test.dart" as StreamConsumer_A01_t01; import "hashCode_A01_t01.test.dart" as hashCode_A01_t01; import "runtimeType_A01_t01.test.dart" as runtimeType_A01_t01; @@ -23,6 +24,7 @@ import "noSuchMethodError_A01_t01.test.dart" as noSuchMethodError_A01_t01; import "toString_A01_t01.test.dart" as toString_A01_t01; test(StreamConsumer create()) { + asyncStart(); StreamConsumer_A01_t01.test(create); hashCode_A01_t01.test(create); runtimeType_A01_t01.test(create); @@ -32,4 +34,5 @@ test(StreamConsumer create()) { close_A01_t01.test(create); noSuchMethodError_A01_t01.test(create); toString_A01_t01.test(create); + asyncEnd(); } diff --git a/LibTest/async/StreamController/StreamController.broadcast_A01_t01.dart b/LibTest/async/StreamController/StreamController.broadcast_A01_t01.dart index e8513935ce..d9b19a547b 100644 --- a/LibTest/async/StreamController/StreamController.broadcast_A01_t01.dart +++ b/LibTest/async/StreamController/StreamController.broadcast_A01_t01.dart @@ -46,6 +46,8 @@ check(List events0) { } main() { + asyncStart(); check([]); check([1, 2, null, []]); + asyncEnd(); } diff --git a/LibTest/async/StreamController/StreamController.broadcast_A01_t03.dart b/LibTest/async/StreamController/StreamController.broadcast_A01_t03.dart index 3e351714e2..a64bcf6211 100644 --- a/LibTest/async/StreamController/StreamController.broadcast_A01_t03.dart +++ b/LibTest/async/StreamController/StreamController.broadcast_A01_t03.dart @@ -61,9 +61,11 @@ check(List events) { } main() { + asyncStart(); check([]); check([1, 2, null, []]); check([1, 2, -1, "aaa", -3, 10]); check([-1, -2, -1, -3, -10]); check([-1, 1, -2, 2, "hello", "world", -10]); + asyncEnd(); } diff --git a/LibTest/async/StreamController/StreamController.broadcast_A06_t02.dart b/LibTest/async/StreamController/StreamController.broadcast_A06_t02.dart index c175fe4ef4..31ac4560fc 100644 --- a/LibTest/async/StreamController/StreamController.broadcast_A06_t02.dart +++ b/LibTest/async/StreamController/StreamController.broadcast_A06_t02.dart @@ -26,8 +26,8 @@ main() { Stream stream = controller.stream; int event1 = 0; - asyncStart(); - StreamSubscription sub1 = stream.listen( + asyncStart(2); + stream.listen( (event){ Expect.equals(event1, event); event1++; @@ -38,8 +38,7 @@ main() { ); int event2 = 0; - asyncStart(); - StreamSubscription sub2 = stream.listen( + stream.listen( (event){ Expect.equals(event2, event); event2++; diff --git a/LibTest/async/StreamController/StreamController.broadcast_A06_t03.dart b/LibTest/async/StreamController/StreamController.broadcast_A06_t03.dart index 1d555778af..d5819a63c5 100644 --- a/LibTest/async/StreamController/StreamController.broadcast_A06_t03.dart +++ b/LibTest/async/StreamController/StreamController.broadcast_A06_t03.dart @@ -26,7 +26,7 @@ main() { Stream stream = controller.stream; int event1 = 0; - asyncStart(); + asyncStart(2); stream.listen( (event) { Expect.equals(event1, event); @@ -36,14 +36,12 @@ main() { asyncEnd(); } ); - for (int k = 0; k < 5; k++) { controller.add(k); } int event2 = 5; - asyncStart(); - StreamSubscription sub2 = stream.listen( + stream.listen( (event) { Expect.equals(event2, event); event2++; @@ -52,7 +50,6 @@ main() { asyncEnd(); } ); - for (int k = 5; k < 10; k++) { controller.add(k); } diff --git a/LibTest/async/StreamController/StreamController_A03_t01.dart b/LibTest/async/StreamController/StreamController_A03_t01.dart index 851b9bdc4f..2469875847 100644 --- a/LibTest/async/StreamController/StreamController_A03_t01.dart +++ b/LibTest/async/StreamController/StreamController_A03_t01.dart @@ -37,7 +37,9 @@ void check(List source) { } main() { + asyncStart(); check([]); check([null, null, null, null]); check([1, 2, 3, 4, 5, 6, 7, 8, 9, 0]); + asyncEnd(); } diff --git a/LibTest/async/StreamController/StreamController_A03_t02.dart b/LibTest/async/StreamController/StreamController_A03_t02.dart index adcac16ae0..1e36d47401 100644 --- a/LibTest/async/StreamController/StreamController_A03_t02.dart +++ b/LibTest/async/StreamController/StreamController_A03_t02.dart @@ -48,7 +48,9 @@ void check(List source) { } main() { + asyncStart(); check([]); check([-1, -2, -3, -4, -5]); check([1, 2, -3, 4, -5, 6, 7, -8, 9, 0]); + asyncEnd(); } diff --git a/LibTest/async/StreamController/addStream_A01_t01.dart b/LibTest/async/StreamController/addStream_A01_t01.dart index 79988477bf..db37f61341 100644 --- a/LibTest/async/StreamController/addStream_A01_t01.dart +++ b/LibTest/async/StreamController/addStream_A01_t01.dart @@ -23,13 +23,11 @@ main() { Iterable iterable = [1, 2, 3]; Stream s = new Stream.fromIterable(iterable); - asyncStart(); + asyncStart(2); c.stream.toList().then((x) { Expect.listEquals(iterable, x); asyncEnd(); }); - - asyncStart(); c.addStream(s).then((_) { c.close(); asyncEnd(); diff --git a/LibTest/async/StreamController/addStream_A02_t01.dart b/LibTest/async/StreamController/addStream_A02_t01.dart index 4adad89f1b..82a5200720 100644 --- a/LibTest/async/StreamController/addStream_A02_t01.dart +++ b/LibTest/async/StreamController/addStream_A02_t01.dart @@ -18,13 +18,11 @@ main() { List iterable = [1, 2, 3]; Stream s = new Stream.fromIterable(iterable); - asyncStart(); + asyncStart(2); c.stream.toList().then((x) { Expect.listEquals(iterable, x); asyncEnd(); }); - - asyncStart(); c.addStream(s).then((_) { c.close(); asyncEnd(); diff --git a/LibTest/async/StreamController/addStream_A02_t02.dart b/LibTest/async/StreamController/addStream_A02_t02.dart index dbfe01ae9b..a257d5c98a 100644 --- a/LibTest/async/StreamController/addStream_A02_t02.dart +++ b/LibTest/async/StreamController/addStream_A02_t02.dart @@ -17,7 +17,6 @@ listen(Stream stream, List expectedData, List expectedErrors) { List actualData = []; List actualErrors = []; - asyncStart(); stream.listen( (x) { actualData.add(x); @@ -35,10 +34,8 @@ listen(Stream stream, List expectedData, List expectedErrors) { main() { StreamController c = new StreamController(); - + asyncStart(2); listen(c.stream, [1, 2, 3, 4, 5, 6, 7], [0]); - - asyncStart(); c.addStream(new Stream.fromIterable([1, 2, 3])).then((_) { c.add(4); c.addStream(new Stream.fromIterable([5, 6, 7])).then((_) { diff --git a/LibTest/async/StreamController/addStream_A03_t01.dart b/LibTest/async/StreamController/addStream_A03_t01.dart index 66accc1873..80e7c8f8bd 100644 --- a/LibTest/async/StreamController/addStream_A03_t01.dart +++ b/LibTest/async/StreamController/addStream_A03_t01.dart @@ -19,7 +19,6 @@ void listen(Stream stream, List expectedData, List expectedErrors) { List actualData = []; List actualErrors = []; - asyncStart(); stream.listen( (x) { actualData.add(x); @@ -44,9 +43,8 @@ main() { Stream s1 = toDataErrorStream(new Stream.fromIterable(iterable)); Stream s2 = toDataErrorStream(new Stream.fromIterable(iterable)); + asyncStart(2); listen(c.stream, [1, 2, 3, 4, 5, 6, 1, 2, 3], [-1, -2, -3, -1]); - - asyncStart(); c.addStream(s1).then((_) { c.addStream(s2, cancelOnError:true).then((_) { c.close(); diff --git a/LibTest/async/StreamController/addStream_A03_t02.dart b/LibTest/async/StreamController/addStream_A03_t02.dart index 03925b0e94..5b4756736c 100644 --- a/LibTest/async/StreamController/addStream_A03_t02.dart +++ b/LibTest/async/StreamController/addStream_A03_t02.dart @@ -20,7 +20,6 @@ listen(Stream stream, List expectedData, List expectedErrors) { List actualData = []; List actualErrors = []; - asyncStart(); stream.listen( (x) { actualData.add(x); @@ -44,9 +43,8 @@ main() { List iterable = [1, 2, 3, -1, -2, -3, 4, 5, 6]; Stream s = toDataErrorStream(new Stream.fromIterable(iterable)); + asyncStart(2); listen(c.stream, [1, 2, 3, 4, 5, 6], [-1, -2, -3]); - - asyncStart(); c.addStream(s, cancelOnError:false).then((_) { c.close(); asyncEnd(); diff --git a/LibTest/async/StreamIterator/current_A01_t01.dart b/LibTest/async/StreamIterator/current_A01_t01.dart index 5f46bc9953..2422a8330b 100644 --- a/LibTest/async/StreamIterator/current_A01_t01.dart +++ b/LibTest/async/StreamIterator/current_A01_t01.dart @@ -33,8 +33,10 @@ void check(expected) { } main() { + asyncStart(); check(null); check(12345); check("expected"); check(["expected"]); + asyncEnd(); } diff --git a/LibTest/async/StreamIterator/moveNext_A01_t01.dart b/LibTest/async/StreamIterator/moveNext_A01_t01.dart index 5284770ce0..3f387467b4 100644 --- a/LibTest/async/StreamIterator/moveNext_A01_t01.dart +++ b/LibTest/async/StreamIterator/moveNext_A01_t01.dart @@ -37,8 +37,6 @@ main() { } }); } - asyncStart(); - f(); } diff --git a/LibTest/async/StreamSink/addStream_A01_t01.dart b/LibTest/async/StreamSink/addStream_A01_t01.dart index 021d4c0b44..c5001c4cf9 100644 --- a/LibTest/async/StreamSink/addStream_A01_t01.dart +++ b/LibTest/async/StreamSink/addStream_A01_t01.dart @@ -20,13 +20,12 @@ main() { var c = new StreamController(); var sink = c.sink; - asyncStart(); + asyncStart(2); sink.addStream(from).then((_) { c.close(); asyncEnd(); }); - asyncStart(); c.stream.toList().then((x) { Expect.listEquals([1,2,3,4,5], x); asyncEnd(); diff --git a/LibTest/async/StreamTransformer/StreamTransformer_A03_t02.dart b/LibTest/async/StreamTransformer/StreamTransformer_A03_t02.dart index 82e32c136b..f6765bd3f0 100644 --- a/LibTest/async/StreamTransformer/StreamTransformer_A03_t02.dart +++ b/LibTest/async/StreamTransformer/StreamTransformer_A03_t02.dart @@ -54,13 +54,11 @@ main() { c.addError(5); asyncStart(); - c.stream.transform(myTransformer()).toList().then( (x) { Expect.listEquals([1,2,3,6,5,10,1,2,3,4,5], x); asyncEnd(); } ); - c.close(); } diff --git a/LibTest/async/Timer/Timer.periodic_A02_t01.dart b/LibTest/async/Timer/Timer.periodic_A02_t01.dart index a25a3f3da8..cb3c5f0a3f 100644 --- a/LibTest/async/Timer/Timer.periodic_A02_t01.dart +++ b/LibTest/async/Timer/Timer.periodic_A02_t01.dart @@ -24,7 +24,9 @@ check(int delay) { } main() { + asyncStart(); check(0); check(-1); check(-10); + asyncEnd(); } diff --git a/LibTest/async/Timer/Timer_A01_t01.dart b/LibTest/async/Timer/Timer_A01_t01.dart index 25905912f8..08afc64f4c 100644 --- a/LibTest/async/Timer/Timer_A01_t01.dart +++ b/LibTest/async/Timer/Timer_A01_t01.dart @@ -35,6 +35,7 @@ check(int delayms) { } main() { + asyncStart(); check(150); check(100); check(50); @@ -45,4 +46,5 @@ main() { check(0); check(-5); check(-50); + asyncEnd(); } diff --git a/LibTest/async/Timer/Timer_A02_t01.dart b/LibTest/async/Timer/Timer_A02_t01.dart index 920e01027d..f2f9690fe2 100644 --- a/LibTest/async/Timer/Timer_A02_t01.dart +++ b/LibTest/async/Timer/Timer_A02_t01.dart @@ -22,8 +22,10 @@ check(int delayms) { } main() { + asyncStart(); check(0); check(-1); check(-10); check(-100); + asyncEnd(); } diff --git a/LibTest/async/Timer/isActive_A01_t01.dart b/LibTest/async/Timer/isActive_A01_t01.dart index 8993628e70..9c617a9f89 100644 --- a/LibTest/async/Timer/isActive_A01_t01.dart +++ b/LibTest/async/Timer/isActive_A01_t01.dart @@ -26,9 +26,11 @@ check(int delayms) { } main() { + asyncStart(); check(10); check(1); check(0); check(-1); check(-10); + asyncEnd(); } diff --git a/LibTest/async/Timer/isActive_A01_t02.dart b/LibTest/async/Timer/isActive_A01_t02.dart index 776a79a6c6..9a1e0dfec3 100644 --- a/LibTest/async/Timer/isActive_A01_t02.dart +++ b/LibTest/async/Timer/isActive_A01_t02.dart @@ -33,9 +33,11 @@ check(int delay) { } main() { + asyncStart(); check(10); check(1); check(0); check(-1); check(-10); + asyncEnd(); } diff --git a/LibTest/async/Timer/run_A01_t02.dart b/LibTest/async/Timer/run_A01_t02.dart index ae2772df10..465e4633b7 100644 --- a/LibTest/async/Timer/run_A01_t02.dart +++ b/LibTest/async/Timer/run_A01_t02.dart @@ -24,8 +24,10 @@ check(value) { } main() { + asyncStart(); check(0); check(-5); check('string'); check(true); + asyncEnd(); } diff --git a/LibTest/async/Zone/createPeriodicTimer_A01_t01.dart b/LibTest/async/Zone/createPeriodicTimer_A01_t01.dart index 276621c3d4..802764be3f 100644 --- a/LibTest/async/Zone/createPeriodicTimer_A01_t01.dart +++ b/LibTest/async/Zone/createPeriodicTimer_A01_t01.dart @@ -28,6 +28,8 @@ void test(Zone zone) { } main() { + asyncStart(); test(Zone.current); test(Zone.current.fork()); + asyncEnd(); } diff --git a/LibTest/async/Zone/createTimer_A01_t01.dart b/LibTest/async/Zone/createTimer_A01_t01.dart index a3c999ff6e..474dc970eb 100644 --- a/LibTest/async/Zone/createTimer_A01_t01.dart +++ b/LibTest/async/Zone/createTimer_A01_t01.dart @@ -28,6 +28,8 @@ void test(Zone zone) { } main() { + asyncStart(); test(Zone.current); test(Zone.current.fork()); + asyncEnd(); } diff --git a/LibTest/async/Zone/inSameErrorZone_A01_t03.dart b/LibTest/async/Zone/inSameErrorZone_A01_t03.dart index 530a86e052..7495fb8983 100644 --- a/LibTest/async/Zone/inSameErrorZone_A01_t03.dart +++ b/LibTest/async/Zone/inSameErrorZone_A01_t03.dart @@ -31,7 +31,7 @@ diff() { main() { runZonedGuarded(() { - asyncStart(); + asyncStart(2); // new error zone diff(); // error is caught by catchError @@ -43,7 +43,6 @@ main() { runZoned(() { // not error zone, shares callback with the parent same(); - asyncStart(); // catchError is registered in same error zone // error is caught by catchError new Future.error(2).catchError((_) { diff --git a/LibTest/async/Zone/scheduleMicrotask_A01_t01.dart b/LibTest/async/Zone/scheduleMicrotask_A01_t01.dart index 0643ee504a..e004e80001 100644 --- a/LibTest/async/Zone/scheduleMicrotask_A01_t01.dart +++ b/LibTest/async/Zone/scheduleMicrotask_A01_t01.dart @@ -17,8 +17,6 @@ main() { x = 1; asyncEnd(); }); - Expect.isNull(x); - asyncStart(); } diff --git a/LibTest/async/Zone/scheduleMicrotask_A01_t02.dart b/LibTest/async/Zone/scheduleMicrotask_A01_t02.dart index 548fe0a1f8..b430878790 100644 --- a/LibTest/async/Zone/scheduleMicrotask_A01_t02.dart +++ b/LibTest/async/Zone/scheduleMicrotask_A01_t02.dart @@ -19,6 +19,8 @@ test(Zone z) { } main() { + asyncStart(); test(Zone.current); test(Zone.current.fork()); + asyncEnd(); }