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 "dart:async"; | 5 import "dart:async"; |
| 6 import "package:expect/expect.dart"; | 6 import "package:expect/expect.dart"; |
| 7 import "package:async_helper/async_helper.dart"; | 7 import "package:async_helper/async_helper.dart"; |
| 8 | 8 |
| 9 class Tracer { | 9 class Tracer { |
| 10 final String expected; | 10 final String expected; |
| 11 final String name; | 11 final String name; |
| 12 int counter = 0; | 12 int counter = 0; |
| 13 | 13 |
| 14 Tracer(this.expected, [this.name]); | 14 Tracer(this.expected, [this.name]); |
| 15 | 15 |
| 16 void trace(msg) { | 16 void trace(msg) { |
| 17 if (name != null) { | 17 if (name != null) { |
| 18 print("Tracing $name: $msg"); | 18 //print("Tracing $name: $msg"); |
|
vsm
2015/08/03 20:57:33
Maybe a comment here? Hmm - ideally we'd have a
Jennifer Messerly
2015/08/03 21:08:11
Done.
| |
| 19 } | 19 } |
| 20 Expect.equals(expected[counter], msg); | 20 Expect.equals(expected[counter], msg); |
| 21 counter++; | 21 counter++; |
| 22 } | 22 } |
| 23 | 23 |
| 24 void done() { | 24 void done() { |
| 25 Expect.equals(expected.length, counter, "Received too few traces"); | 25 Expect.equals(expected.length, counter, "Received too few traces"); |
| 26 } | 26 } |
| 27 } | 27 } |
| 28 | 28 |
| (...skipping 438 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 467 await runTest("abcdefgX", foo14, "Error3"); | 467 await runTest("abcdefgX", foo14, "Error3"); |
| 468 await runTest("abcdefg", foo15); | 468 await runTest("abcdefg", foo15); |
| 469 await runTest("abcdfg", foo16); | 469 await runTest("abcdfg", foo16); |
| 470 await runTest("abcdef", foo17); | 470 await runTest("abcdef", foo17); |
| 471 await runTest("abcde", foo18); | 471 await runTest("abcde", foo18); |
| 472 } | 472 } |
| 473 | 473 |
| 474 void main() { | 474 void main() { |
| 475 asyncTest(test); | 475 asyncTest(test); |
| 476 } | 476 } |
| OLD | NEW |