Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(31)

Unified Diff: pkg/analyzer2dart/test/output_helper.dart

Issue 669673006: Add SExpression test and share tests between dart2dart and analyzer2dart. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Updated cf. comments. Created 6 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « pkg/analyzer2dart/test/end2end_test.dart ('k') | pkg/analyzer2dart/test/sexpr_data.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/analyzer2dart/test/output_helper.dart
diff --git a/pkg/analyzer2dart/test/output_helper.dart b/pkg/analyzer2dart/test/output_helper.dart
new file mode 100644
index 0000000000000000000000000000000000000000..5a3f6b4feba84e80a46cc3149973a0cf64ee6604
--- /dev/null
+++ b/pkg/analyzer2dart/test/output_helper.dart
@@ -0,0 +1,32 @@
+// Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
+
+/// Helper classes for testing compiler output.
+library test.output_helper;
+
+import 'dart:async';
+
+
+class CollectingOutputProvider {
+ StringBufferSink output;
+
+ EventSink<String> call(String name, String extension) {
+ return output = new StringBufferSink();
+ }
+}
+
+class StringBufferSink implements EventSink<String> {
+ StringBuffer sb = new StringBuffer();
+
+ void add(String text) {
+ sb.write(text);
+ }
+
+ void addError(errorEvent, [StackTrace stackTrace]) {}
+
+ void close() {}
+
+ String get text => sb.toString();
+}
+
« no previous file with comments | « pkg/analyzer2dart/test/end2end_test.dart ('k') | pkg/analyzer2dart/test/sexpr_data.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698