Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file |
| 2 // for details. All rights reserved. Use of this source code is governed by a | 2 // for details. All rights reserved. Use of this source code is governed by a |
| 3 // BSD-style license that can be found in the LICENSE file. | 3 // BSD-style license that can be found in the LICENSE file. |
| 4 | 4 |
| 5 import 'package:test/src/backend/state.dart'; | 5 import 'package:test/src/backend/state.dart'; |
| 6 import 'package:test/test.dart'; | 6 import 'package:test/test.dart'; |
| 7 | 7 |
| 8 import '../utils.dart'; | 8 import '../utils.dart'; |
| 9 | 9 |
| 10 void main() { | 10 void main() { |
| (...skipping 12 matching lines...) Expand all Loading... | |
| 23 | 23 |
| 24 test("1", () { | 24 test("1", () { |
| 25 var callbackRun = false; | 25 var callbackRun = false; |
| 26 return runTestBody(() { | 26 return runTestBody(() { |
| 27 expectAsync((arg) { | 27 expectAsync((arg) { |
| 28 expect(arg, equals(1)); | 28 expect(arg, equals(1)); |
| 29 callbackRun = true; | 29 callbackRun = true; |
| 30 })(1); | 30 })(1); |
| 31 }).then((liveTest) { | 31 }).then((liveTest) { |
| 32 expectTestPassed(liveTest); | 32 expectTestPassed(liveTest); |
| 33 expect(callbackRun, isTrue); | 33 expect(callbackRun, isFalse); |
|
kevmoo
2015/04/23 00:13:14
sure? this failed for me.
nweiz
2015/04/23 00:15:52
Done.
| |
| 34 }); | 34 }); |
| 35 }); | 35 }); |
| 36 | 36 |
| 37 test("2", () { | 37 test("2", () { |
| 38 var callbackRun = false; | 38 var callbackRun = false; |
| 39 return runTestBody(() { | 39 return runTestBody(() { |
| 40 expectAsync((arg1, arg2) { | 40 expectAsync((arg1, arg2) { |
| 41 expect(arg1, equals(1)); | 41 expect(arg1, equals(1)); |
| 42 expect(arg2, equals(2)); | 42 expect(arg2, equals(2)); |
| 43 callbackRun = true; | 43 callbackRun = true; |
| 44 })(1, 2); | 44 })(1, 2); |
| 45 }).then((liveTest) { | 45 }).then((liveTest) { |
| 46 expectTestPassed(liveTest); | 46 expectTestPassed(liveTest); |
| 47 expect(callbackRun, isTrue); | 47 expect(callbackRun, isFalse); |
|
kevmoo
2015/04/23 00:13:14
ditto
nweiz
2015/04/23 00:15:52
Done.
| |
| 48 }); | 48 }); |
| 49 }); | 49 }); |
| 50 | 50 |
| 51 test("3", () { | 51 test("3", () { |
| 52 var callbackRun = false; | 52 var callbackRun = false; |
| 53 return runTestBody(() { | 53 return runTestBody(() { |
| 54 expectAsync((arg1, arg2, arg3) { | 54 expectAsync((arg1, arg2, arg3) { |
| 55 expect(arg1, equals(1)); | 55 expect(arg1, equals(1)); |
| 56 expect(arg2, equals(2)); | 56 expect(arg2, equals(2)); |
| 57 expect(arg3, equals(3)); | 57 expect(arg3, equals(3)); |
| (...skipping 261 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 319 caughtError = true; | 319 caughtError = true; |
| 320 } | 320 } |
| 321 }).then((liveTest) { | 321 }).then((liveTest) { |
| 322 expectTestFailed(liveTest, 'oh no'); | 322 expectTestFailed(liveTest, 'oh no'); |
| 323 expect(returnValue, isNull); | 323 expect(returnValue, isNull); |
| 324 expect(caughtError, isFalse); | 324 expect(caughtError, isFalse); |
| 325 }); | 325 }); |
| 326 }); | 326 }); |
| 327 }); | 327 }); |
| 328 } | 328 } |
| OLD | NEW |