OLD | NEW |
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 import 'package:expect/expect.dart'; | 5 import 'package:expect/expect.dart'; |
6 import 'memory_source_file_helper.dart'; | 6 import 'memory_source_file_helper.dart'; |
7 import "package:async_helper/async_helper.dart"; | 7 import "package:async_helper/async_helper.dart"; |
8 | 8 |
9 import 'package:compiler/compiler.dart' | 9 import 'package:compiler/compiler.dart' |
10 show Diagnostic; | 10 show Diagnostic; |
(...skipping 15 matching lines...) Expand all Loading... |
26 } | 26 } |
27 if (kind == Diagnostic.ERROR) { | 27 if (kind == Diagnostic.ERROR) { |
28 errorCount++; | 28 errorCount++; |
29 } else if (kind == Diagnostic.WARNING) { | 29 } else if (kind == Diagnostic.WARNING) { |
30 warningCount++; | 30 warningCount++; |
31 } else { | 31 } else { |
32 throw 'unexpected diagnostic $kind: $message'; | 32 throw 'unexpected diagnostic $kind: $message'; |
33 } | 33 } |
34 } | 34 } |
35 | 35 |
36 Compiler compiler = new Compiler( | 36 CompilerImpl compiler = new CompilerImpl( |
37 new LegacyCompilerInput(provider.readStringFromUri), | 37 new LegacyCompilerInput(provider.readStringFromUri), |
38 new LegacyCompilerOutput(), | 38 new LegacyCompilerOutput(), |
39 new LegacyCompilerDiagnostics(diagnosticHandler), | 39 new LegacyCompilerDiagnostics(diagnosticHandler), |
40 libraryRoot, | 40 libraryRoot, |
41 packageRoot, | 41 packageRoot, |
42 [Flags.analyzeOnly], | 42 [Flags.analyzeOnly], |
43 {}); | 43 {}); |
44 asyncTest(() => compiler.run(Uri.parse('memory:main.dart')).then((_) { | 44 asyncTest(() => compiler.run(Uri.parse('memory:main.dart')).then((_) { |
45 Expect.isTrue(compiler.compilationFailed); | 45 Expect.isTrue(compiler.compilationFailed); |
46 Expect.equals(5, errorCount); | 46 Expect.equals(5, errorCount); |
(...skipping 14 matching lines...) Expand all Loading... |
61 } | 61 } |
62 | 62 |
63 for ((){}() in []) { | 63 for ((){}() in []) { |
64 } | 64 } |
65 | 65 |
66 for (1 in []) { | 66 for (1 in []) { |
67 } | 67 } |
68 } | 68 } |
69 """ | 69 """ |
70 }; | 70 }; |
OLD | NEW |