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

Side by Side Diff: tests/compiler/dart2js/diagnose_ambiguous_test.dart

Issue 1415463022: Use DiagnosticMessage in MockCompiler. (Closed) Base URL: https://github.com/dart-lang/sdk.git@master
Patch Set: Created 5 years, 1 month 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 unified diff | Download patch
OLDNEW
1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2013, 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 5
6 import 'package:async_helper/async_helper.dart'; 6 import 'package:async_helper/async_helper.dart';
7 import 'package:compiler/compiler_new.dart' show Diagnostic; 7 import 'package:compiler/compiler_new.dart' show Diagnostic;
8 import 'package:expect/expect.dart'; 8 import 'package:expect/expect.dart';
9 import 'memory_compiler.dart'; 9 import 'memory_compiler.dart';
10 10
11 void main() { 11 void main() {
12 DiagnosticCollector collector = new DiagnosticCollector(); 12 DiagnosticCollector collector = new DiagnosticCollector();
13 asyncTest(() async { 13 asyncTest(() async {
14 CompilationResult result = await runCompiler( 14 CompilationResult result = await runCompiler(
15 memorySourceFiles: MEMORY_SOURCE_FILES, 15 memorySourceFiles: MEMORY_SOURCE_FILES,
16 diagnosticHandler: collector, 16 diagnosticHandler: collector,
17 options: ['--analyze-all']); 17 options: ['--analyze-all']);
18 18
19 List<String> diagnostics = <String>[]; 19 List<String> diagnostics = <String>[];
20 collector.messages.forEach((DiagnosticMessage message) { 20 collector.messages.forEach((CollectedMessage message) {
21 if (message.kind == Diagnostic.VERBOSE_INFO) return; 21 if (message.kind == Diagnostic.VERBOSE_INFO) return;
22 diagnostics.add(message.toString()); 22 diagnostics.add(message.toString());
23 }); 23 });
24 diagnostics.sort(); 24 diagnostics.sort();
25 var expected = [ 25 var expected = [
26 "memory:exporter.dart:43:47:'hest' is defined here.:info", 26 "memory:exporter.dart:43:47:'hest' is defined here.:info",
27 "memory:library.dart:41:45:'hest' is defined here.:info", 27 "memory:library.dart:41:45:'hest' is defined here.:info",
28 "memory:main.dart:0:22:'hest' is imported here.:info", 28 "memory:main.dart:0:22:'hest' is imported here.:info",
29 "memory:main.dart:23:46:'hest' is imported here.:info", 29 "memory:main.dart:23:46:'hest' is imported here.:info",
30 "memory:main.dart:86:92:Duplicate import of 'hest'.:warning", 30 "memory:main.dart:86:92:Duplicate import of 'hest'.:warning",
(...skipping 25 matching lines...) Expand all
56 hest() {} 56 hest() {}
57 """, 57 """,
58 'exporter.dart': """ 58 'exporter.dart': """
59 library exporter; 59 library exporter;
60 60
61 export 'library.dart'; 61 export 'library.dart';
62 62
63 hest() {} 63 hest() {}
64 """, 64 """,
65 }; 65 };
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698