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

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

Issue 52723007: Revert "Change dart:io Platform.script to return a Uri." (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 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 | 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 dart2js produces the expected static type warnings for type 5 // Test that dart2js produces the expected static type warnings for type
6 // promotion langauge tests. This ensures that the analyzer and dart2js agrees 6 // promotion langauge tests. This ensures that the analyzer and dart2js agrees
7 // on these tests. 7 // on these tests.
8 8
9 import 'dart:async'; 9 import 'dart:async';
10 import 'dart:io'; 10 import 'dart:io';
(...skipping 10 matching lines...) Expand all
21 'language/type_promotion_closure_test.dart', 21 'language/type_promotion_closure_test.dart',
22 'language/type_promotion_functions_test.dart', 22 'language/type_promotion_functions_test.dart',
23 'language/type_promotion_local_test.dart', 23 'language/type_promotion_local_test.dart',
24 'language/type_promotion_logical_and_test.dart', 24 'language/type_promotion_logical_and_test.dart',
25 'language/type_promotion_more_specific_test.dart', 25 'language/type_promotion_more_specific_test.dart',
26 'language/type_promotion_multiple_test.dart', 26 'language/type_promotion_multiple_test.dart',
27 'language/type_promotion_parameter_test.dart', 27 'language/type_promotion_parameter_test.dart',
28 ]; 28 ];
29 29
30 void main() { 30 void main() {
31 bool isWindows = Platform.isWindows; 31 bool isWindows = (Platform.operatingSystem == 'windows');
32 Uri script = currentDirectory.resolveUri(Platform.script); 32 Uri script = currentDirectory.resolve(nativeToUriPath(Platform.script));
33 bool warningsMismatch = false; 33 bool warningsMismatch = false;
34 Future.forEach(TESTS, (String test) { 34 Future.forEach(TESTS, (String test) {
35 Uri uri = script.resolve('../../$test'); 35 Uri uri = script.resolve('../../$test');
36 String source = UTF8.decode(readAll(uriPathToNative(uri.path))); 36 String source = UTF8.decode(readAll(uriPathToNative(uri.path)));
37 SourceFile file = new StringSourceFile( 37 SourceFile file = new StringSourceFile(
38 relativize(currentDirectory, uri, isWindows), source); 38 relativize(currentDirectory, uri, isWindows), source);
39 Map<int,String> expectedWarnings = {}; 39 Map<int,String> expectedWarnings = {};
40 int lineNo = 0; 40 int lineNo = 0;
41 for (String line in source.split('\n')) { 41 for (String line in source.split('\n')) {
42 if (line.contains('///') && line.contains('static type warning')) { 42 if (line.contains('///') && line.contains('static type warning')) {
(...skipping 26 matching lines...) Expand all
69 String line = expectedWarnings[lineNo]; 69 String line = expectedWarnings[lineNo];
70 print('$uri [${lineNo+1}]: Missing static type warning.'); 70 print('$uri [${lineNo+1}]: Missing static type warning.');
71 print(line); 71 print(line);
72 } 72 }
73 } 73 }
74 }); 74 });
75 }).then((_) { 75 }).then((_) {
76 Expect.isFalse(warningsMismatch); 76 Expect.isFalse(warningsMismatch);
77 }); 77 });
78 } 78 }
OLDNEW
« no previous file with comments | « tests/compiler/dart2js/package_root_test.dart ('k') | tests/compiler/dart2js/unneeded_part_js_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698