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

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

Issue 841653004: Recover from read errors. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge
Patch Set: Merged with r42871 Created 5 years, 11 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 unified diff | Download patch | Annotate | Revision Log
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 // Test that the compiler can handle missing files used in imports, exports, 5 // Test that the compiler can handle missing files used in imports, exports,
6 // part tags or as the main source file. 6 // part tags or as the main source file.
7 7
8 library dart2js.test.import; 8 library dart2js.test.import;
9 9
10 import 'package:expect/expect.dart'; 10 import 'package:expect/expect.dart';
(...skipping 15 matching lines...) Expand all
26 int i = ""; 26 int i = "";
27 } 27 }
28 ''', 28 ''',
29 }; 29 };
30 30
31 testMissingImports() { 31 testMissingImports() {
32 var collector = new DiagnosticCollector(); 32 var collector = new DiagnosticCollector();
33 var compiler = compilerFor(MEMORY_SOURCE_FILES, diagnosticHandler: collector); 33 var compiler = compilerFor(MEMORY_SOURCE_FILES, diagnosticHandler: collector);
34 asyncTest(() => compiler.run(Uri.parse('memory:main.dart')).then((_) { 34 asyncTest(() => compiler.run(Uri.parse('memory:main.dart')).then((_) {
35 Expect.equals(4, collector.errors.length); 35 Expect.equals(4, collector.errors.length);
36 // TODO(johnniwinther): Expect 1 warning when analysis of programs with load 36 Expect.equals(1, collector.warnings.length);
37 // failures is reenabled.
38 Expect.equals(0, collector.warnings.length);
39 })); 37 }));
40 } 38 }
41 39
42 testMissingMain() { 40 testMissingMain() {
43 var collector = new DiagnosticCollector(); 41 var collector = new DiagnosticCollector();
44 var compiler = compilerFor({}, diagnosticHandler: collector); 42 var compiler = compilerFor({}, diagnosticHandler: collector);
45 asyncTest(() => compiler.run(Uri.parse('memory:missing.dart')).then((_) { 43 asyncTest(() => compiler.run(Uri.parse('memory:missing.dart')).then((_) {
46 Expect.equals(1, collector.errors.length); 44 Expect.equals(1, collector.errors.length);
47 Expect.equals(0, collector.warnings.length); 45 Expect.equals(0, collector.warnings.length);
48 })); 46 }));
49 } 47 }
50 48
51 void main() { 49 void main() {
52 testMissingImports(); 50 testMissingImports();
53 testMissingMain(); 51 testMissingMain();
54 } 52 }
OLDNEW
« no previous file with comments | « dart/pkg/compiler/lib/src/warnings.dart ('k') | dart/tests/compiler/dart2js/message_kind_helper.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698