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

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

Issue 263103003: Remove warnings from dart2js test-suite. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Remove debug code. Created 6 years, 7 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
« no previous file with comments | « sdk/lib/mirrors/mirrors.dart ('k') | tests/compiler/dart2js/begin_end_token_test.dart » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 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.missing_file; 7 library dart2js.test.missing_file;
8 8
9 import 'dart:io' show exit; 9 import 'dart:io' show exit;
10 import 'package:expect/expect.dart'; 10 import 'package:expect/expect.dart';
11 import "package:async_helper/async_helper.dart";
12 11
13 import '../../../sdk/lib/_internal/compiler/compiler.dart' 12 import '../../../sdk/lib/_internal/compiler/compiler.dart'
14 show Diagnostic; 13 show Diagnostic;
15 import '../../../sdk/lib/_internal/compiler/implementation/dart2js.dart' 14 import '../../../sdk/lib/_internal/compiler/implementation/dart2js.dart'
16 show exitFunc, compileFunc, compile, diagnosticHandler; 15 show exitFunc, compileFunc, compile, diagnosticHandler;
17 import '../../../sdk/lib/_internal/compiler/implementation/source_file_provider. dart' 16 import '../../../sdk/lib/_internal/compiler/implementation/source_file_provider. dart'
18 show FormattingDiagnosticHandler; 17 show FormattingDiagnosticHandler;
19 18
20 class CollectingFormattingDiagnosticHandler 19 class CollectingFormattingDiagnosticHandler
21 implements FormattingDiagnosticHandler { 20 implements FormattingDiagnosticHandler {
(...skipping 16 matching lines...) Expand all
38 messages.add([message, kind]); 37 messages.add([message, kind]);
39 } 38 }
40 39
41 void diagnosticHandler(Uri uri, int begin, int end, String message, kind) { 40 void diagnosticHandler(Uri uri, int begin, int end, String message, kind) {
42 messages.add([message, kind]); 41 messages.add([message, kind]);
43 } 42 }
44 43
45 void call(Uri uri, int begin, int end, String message, kind) { 44 void call(Uri uri, int begin, int end, String message, kind) {
46 diagnosticHandler(uri, begin, end, message, kind); 45 diagnosticHandler(uri, begin, end, message, kind);
47 } 46 }
47
48 String prefixMessage(String message, Diagnostic kind) {
49 return message;
50 }
48 } 51 }
49 52
50 testOutputProvider(script, libraryRoot, packageRoot, inputProvider, handler, 53 testOutputProvider(script, libraryRoot, packageRoot, inputProvider, handler,
51 [options, outputProvider, environment]) { 54 [options, outputProvider, environment]) {
52 diagnosticHandler = new CollectingFormattingDiagnosticHandler(); 55 diagnosticHandler = new CollectingFormattingDiagnosticHandler();
53 outputProvider("/non/existing/directory/should/fail/file", "js"); 56 outputProvider("/non/existing/directory/should/fail/file", "js");
54 } 57 }
55 58
56 void main() { 59 void main() {
57 compileFunc = testOutputProvider; 60 compileFunc = testOutputProvider;
58 exitFunc = (exitCode) { 61 exitFunc = (exitCode) {
59 Expect.equals(1, diagnosticHandler.messages.length); 62 CollectingFormattingDiagnosticHandler handler = diagnosticHandler;
60 var message = diagnosticHandler.messages[0]; 63 Expect.equals(1, handler.messages.length);
64 var message = handler.messages[0];
61 Expect.isTrue(message[0].contains("Cannot open file")); 65 Expect.isTrue(message[0].contains("Cannot open file"));
62 Expect.equals(Diagnostic.ERROR, message[1]); 66 Expect.equals(Diagnostic.ERROR, message[1]);
63 Expect.equals(1, exitCode); 67 Expect.equals(1, exitCode);
64 exit(0); 68 exit(0);
65 }; 69 };
66 compile(["foo.dart", "--out=bar.dart"]); 70 compile(["foo.dart", "--out=bar.dart"]);
67 } 71 }
OLDNEW
« no previous file with comments | « sdk/lib/mirrors/mirrors.dart ('k') | tests/compiler/dart2js/begin_end_token_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698