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 'package:expect/expect.dart'; | 5 import 'package:expect/expect.dart'; |
6 import 'package:compiler/implementation/helpers/helpers.dart'; | 6 import 'package:compiler/src/helpers/helpers.dart'; |
7 | 7 |
8 class CollectingOutput implements StatsOutput { | 8 class CollectingOutput implements StatsOutput { |
9 final StringBuffer sb = new StringBuffer(); | 9 final StringBuffer sb = new StringBuffer(); |
10 | 10 |
11 void println(String text) { | 11 void println(String text) { |
12 sb.write('$text\n'); | 12 sb.write('$text\n'); |
13 } | 13 } |
14 | 14 |
15 String toString() => sb.toString(); | 15 String toString() => sb.toString(); |
16 } | 16 } |
(...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
83 } | 83 } |
84 | 84 |
85 void test(f(Stats stats), expectedDump) { | 85 void test(f(Stats stats), expectedDump) { |
86 CollectingOutput output = new CollectingOutput(); | 86 CollectingOutput output = new CollectingOutput(); |
87 Stats stats = new ActiveStats(new ConsolePrinter(output: output)); | 87 Stats stats = new ActiveStats(new ConsolePrinter(output: output)); |
88 f(stats); | 88 f(stats); |
89 stats.dumpStats(); | 89 stats.dumpStats(); |
90 print(output.toString()); | 90 print(output.toString()); |
91 Expect.equals(expectedDump, output.toString()); | 91 Expect.equals(expectedDump, output.toString()); |
92 } | 92 } |
OLD | NEW |