| OLD | NEW |
| (Empty) |
| 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 | |
| 3 // BSD-style license that can be found in the LICENSE file. | |
| 4 | |
| 5 /// Helper classes for testing compiler output. | |
| 6 library test.output_helper; | |
| 7 | |
| 8 import 'dart:async'; | |
| 9 | |
| 10 | |
| 11 class CollectingOutputProvider { | |
| 12 StringBufferSink output; | |
| 13 | |
| 14 EventSink<String> call(String name, String extension) { | |
| 15 return output = new StringBufferSink(); | |
| 16 } | |
| 17 } | |
| 18 | |
| 19 class StringBufferSink implements EventSink<String> { | |
| 20 StringBuffer sb = new StringBuffer(); | |
| 21 | |
| 22 void add(String text) { | |
| 23 sb.write(text); | |
| 24 } | |
| 25 | |
| 26 void addError(errorEvent, [StackTrace stackTrace]) {} | |
| 27 | |
| 28 void close() {} | |
| 29 | |
| 30 String get text => sb.toString(); | |
| 31 } | |
| 32 | |
| OLD | NEW |