| OLD | NEW |
| 1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2014, 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:unittest/unittest.dart'; |
| 8 | 8 |
| 9 import '../utils.dart'; | 9 import '../../utils.dart'; |
| 10 | 10 |
| 11 void main() { | 11 void main() { |
| 12 group("synchronous", () { | 12 group("synchronous", () { |
| 13 test("passes with an expected print", () { | 13 test("passes with an expected print", () { |
| 14 expect(() => print("Hello, world!"), prints("Hello, world!\n")); | 14 expect(() => print("Hello, world!"), prints("Hello, world!\n")); |
| 15 }); | 15 }); |
| 16 | 16 |
| 17 test("combines multiple prints", () { | 17 test("combines multiple prints", () { |
| 18 expect(() { | 18 expect(() { |
| 19 print("Hello"); | 19 print("Hello"); |
| (...skipping 120 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 140 | 140 |
| 141 test("won't let the test end until the Future completes", () { | 141 test("won't let the test end until the Future completes", () { |
| 142 return expectTestBlocks(() { | 142 return expectTestBlocks(() { |
| 143 var completer = new Completer(); | 143 var completer = new Completer(); |
| 144 expect(() => completer.future, prints(isEmpty)); | 144 expect(() => completer.future, prints(isEmpty)); |
| 145 return completer; | 145 return completer; |
| 146 }, (completer) => completer.complete()); | 146 }, (completer) => completer.complete()); |
| 147 }); | 147 }); |
| 148 }); | 148 }); |
| 149 } | 149 } |
| OLD | NEW |