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 // Test that the compiler can handle imports when package root has not been set. | 5 // Test that the compiler can handle imports when package root has not been set. |
6 | 6 |
7 library dart2js.test.bad_output_io; | 7 library dart2js.test.bad_output_io; |
8 | 8 |
9 import 'dart:async' show Future; | 9 import 'dart:async' show Future; |
10 import 'dart:io' show exit; | 10 import 'dart:io' show exit; |
(...skipping 16 matching lines...) Expand all Loading... |
27 | 27 |
28 class CollectingFormattingDiagnosticHandler | 28 class CollectingFormattingDiagnosticHandler |
29 implements FormattingDiagnosticHandler { | 29 implements FormattingDiagnosticHandler { |
30 final provider = null; | 30 final provider = null; |
31 bool showWarnings = true; | 31 bool showWarnings = true; |
32 bool showHints = true; | 32 bool showHints = true; |
33 bool verbose = true; | 33 bool verbose = true; |
34 bool isAborting = false; | 34 bool isAborting = false; |
35 bool enableColors = false; | 35 bool enableColors = false; |
36 bool throwOnError = false; | 36 bool throwOnError = false; |
| 37 bool autoReadFileUri = false; |
37 var lastKind = null; | 38 var lastKind = null; |
38 | 39 |
39 final int FATAL = 0; | 40 final int FATAL = 0; |
40 final int INFO = 1; | 41 final int INFO = 1; |
41 | 42 |
42 final messages = []; | 43 final messages = []; |
43 | 44 |
44 void info(var message, [kind]) { | 45 void info(var message, [kind]) { |
45 messages.add([message, kind]); | 46 messages.add([message, kind]); |
46 } | 47 } |
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
81 CollectingFormattingDiagnosticHandler handler = diagnosticHandler; | 82 CollectingFormattingDiagnosticHandler handler = diagnosticHandler; |
82 Expect.equals(1, handler.messages.length); | 83 Expect.equals(1, handler.messages.length); |
83 var message = handler.messages[0]; | 84 var message = handler.messages[0]; |
84 Expect.isTrue(message[0].contains("Cannot open file")); | 85 Expect.isTrue(message[0].contains("Cannot open file")); |
85 Expect.equals(Diagnostic.ERROR, message[1]); | 86 Expect.equals(Diagnostic.ERROR, message[1]); |
86 Expect.equals(1, exitCode); | 87 Expect.equals(1, exitCode); |
87 exit(0); | 88 exit(0); |
88 }; | 89 }; |
89 compile(["foo.dart", "--out=bar.dart"]); | 90 compile(["foo.dart", "--out=bar.dart"]); |
90 } | 91 } |
OLD | NEW |