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

Unified Diff: tests/compiler/dart2js/diagnose_ambiguous_test.dart

Issue 1235563003: Add interfaces for a new compiler API. (Closed) Base URL: https://github.com/dart-lang/sdk.git@master
Patch Set: Rebased Created 5 years, 5 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 | « tests/compiler/dart2js/deferred_not_in_main_test.dart ('k') | tests/compiler/dart2js/exit_code_test.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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",
« no previous file with comments | « tests/compiler/dart2js/deferred_not_in_main_test.dart ('k') | tests/compiler/dart2js/exit_code_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698