Index: tests/compiler/dart2js/diagnose_ambiguous_test.dart |
diff --git a/tests/compiler/dart2js/diagnose_ambiguous_test.dart b/tests/compiler/dart2js/diagnose_ambiguous_test.dart |
index d70c8e4279d6fbec4b9bf8f9f8a43a61eb0c1102..9d96426a0647ac6439c893ec35e519fca57b069f 100644 |
--- a/tests/compiler/dart2js/diagnose_ambiguous_test.dart |
+++ b/tests/compiler/dart2js/diagnose_ambiguous_test.dart |
@@ -2,36 +2,25 @@ |
// 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. |
-import 'package:expect/expect.dart'; |
-import "package:async_helper/async_helper.dart"; |
-import 'memory_source_file_helper.dart'; |
- |
-import 'package:compiler/compiler.dart' |
- show Diagnostic; |
-main() { |
- Uri script = currentDirectory.resolveUri(Platform.script); |
- Uri libraryRoot = script.resolve('../../../sdk/'); |
- Uri packageRoot = script.resolve('./packages/'); |
- |
- var provider = new MemorySourceFileProvider(MEMORY_SOURCE_FILES); |
- var diagnostics = []; |
- void diagnosticHandler(Uri uri, int begin, int end, |
- String message, Diagnostic kind) { |
- if (kind == Diagnostic.VERBOSE_INFO) { |
- return; |
- } |
- diagnostics.add('$uri:$begin:$end:$message:$kind'); |
- } |
+import 'package:async_helper/async_helper.dart'; |
+import 'package:compiler/compiler_new.dart' show Diagnostic; |
+import 'package:compiler/src/dart2jslib.dart'; |
+import 'package:expect/expect.dart'; |
+import 'memory_compiler.dart'; |
- Compiler compiler = new Compiler(provider.readStringFromUri, |
- (name, extension) => null, |
- diagnosticHandler, |
- libraryRoot, |
- packageRoot, |
- ['--analyze-all'], |
- {}); |
+void main() { |
+ DiagnosticCollector collector = new DiagnosticCollector(); |
+ Compiler compiler = compilerFor( |
+ MEMORY_SOURCE_FILES, |
+ diagnosticHandler: collector, |
+ options: ['--analyze-all']); |
asyncTest(() => compiler.run(Uri.parse('memory:main.dart')).then((_) { |
+ List<String> diagnostics = <String>[]; |
+ collector.messages.forEach((DiagnosticMessage message) { |
+ if (message.kind == Diagnostic.VERBOSE_INFO) return; |
+ diagnostics.add(message.toString()); |
+ }); |
diagnostics.sort(); |
var expected = [ |
"memory:exporter.dart:43:47:'hest' is defined here.:info", |