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 'dart:async'; | 5 import 'dart:async'; |
6 | 6 |
7 import 'package:unittest/unittest.dart'; | 7 import 'package:test/test.dart'; |
8 | 8 |
9 import '../../utils.dart'; | 9 import '../../utils.dart'; |
10 | 10 |
11 void main() { | 11 void main() { |
12 group("[completes]", () { | 12 group("[completes]", () { |
13 test("blocks the test until the Future completes", () { | 13 test("blocks the test until the Future completes", () { |
14 return expectTestBlocks(() { | 14 return expectTestBlocks(() { |
15 var completer = new Completer(); | 15 var completer = new Completer(); |
16 expect(completer.future, completes); | 16 expect(completer.future, completes); |
17 return completer; | 17 return completer; |
(...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
91 expect(new Future.value('a'), completion(equals('b'))); | 91 expect(new Future.value('a'), completion(equals('b'))); |
92 }).then((liveTest) { | 92 }).then((liveTest) { |
93 expectTestFailed(liveTest, startsWith( | 93 expectTestFailed(liveTest, startsWith( |
94 "Expected: 'b'\n" | 94 "Expected: 'b'\n" |
95 " Actual: 'a'\n" | 95 " Actual: 'a'\n" |
96 " Which: is different."));; | 96 " Which: is different."));; |
97 }); | 97 }); |
98 }); | 98 }); |
99 }); | 99 }); |
100 } | 100 } |
OLD | NEW |