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

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

Issue 16019002: Merge the dart:uri library into dart:core and update the Uri class (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Final cleanup Created 7 years, 6 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) 2012, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2012, 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 deprecated language features are diagnosed correctly. 5 // Test that deprecated language features are diagnosed correctly.
6 6
7 import "package:expect/expect.dart"; 7 import "package:expect/expect.dart";
8 import 'dart:async'; 8 import 'dart:async';
9 import 'dart:uri';
10 9
11 import '../../../sdk/lib/_internal/compiler/compiler.dart'; 10 import '../../../sdk/lib/_internal/compiler/compiler.dart';
12 import '../../utils/dummy_compiler_test.dart' as dummy; 11 import '../../utils/dummy_compiler_test.dart' as dummy;
13 12
14 main() { 13 main() {
15 StringBuffer messages = new StringBuffer(); 14 StringBuffer messages = new StringBuffer();
16 void handler(Uri uri, int begin, int end, String message, Diagnostic kind) { 15 void handler(Uri uri, int begin, int end, String message, Diagnostic kind) {
17 if (kind == Diagnostic.VERBOSE_INFO) return; 16 if (kind == Diagnostic.VERBOSE_INFO) return;
18 if (identical(kind.name, 'source map')) return; 17 if (identical(kind.name, 'source map')) return;
19 if (uri == null) { 18 if (uri == null) {
20 messages.write('$kind: $message\n'); 19 messages.write('$kind: $message\n');
21 } else { 20 } else {
22 Expect.equals('main:${uri.path}', '$uri'); 21 Expect.equals('main:${uri.path}', '$uri');
23 String source = TEST_SOURCE[uri.path]; 22 String source = TEST_SOURCE[uri.path];
24 Expect.isNotNull(source); 23 Expect.isNotNull(source);
25 messages.write('$begin<${source.substring(begin, end)}>:${uri.path}:' 24 messages.write('$begin<${source.substring(begin, end)}>:${uri.path}:'
26 '$kind: $message\n'); 25 '$kind: $message\n');
27 } 26 }
28 } 27 }
29 28
30 Future<String> provider(Uri uri) { 29 Future<String> provider(Uri uri) {
31 if (uri.scheme != "main") return dummy.provider(uri); 30 if (uri.scheme != "main") return dummy.provider(uri);
32 String source = TEST_SOURCE[uri.path]; 31 String source = TEST_SOURCE[uri.path];
33 Expect.isNotNull(source); 32 Expect.isNotNull(source);
34 return new Future<String>.value(source); 33 return new Future<String>.value(source);
35 } 34 }
36 35
37 String code = deprecatedFutureValue( 36 String code = deprecatedFutureValue(
38 compile(new Uri.fromComponents(scheme: 'main'), 37 compile(new Uri(scheme: 'main'),
39 new Uri.fromComponents(scheme: 'lib', path: '/'), 38 new Uri(scheme: 'lib', path: '/'),
40 new Uri.fromComponents(scheme: 'package', path: '/'), 39 new Uri(scheme: 'package', path: '/'),
41 provider, handler)); 40 provider, handler));
42 if (code == null) { 41 if (code == null) {
43 throw 'Compilation failed: ${messages}'; 42 throw 'Compilation failed: ${messages}';
44 } 43 }
45 Expect.stringEquals( 44 Expect.stringEquals(
46 // This string is composed of lines of the following format: 45 // This string is composed of lines of the following format:
47 // 46 //
48 // offset<source>:path:kind: message 47 // offset<source>:path:kind: message
49 // 48 //
50 // "offset" is the character offset from the beginning of TEST_SOURCE. 49 // "offset" is the character offset from the beginning of TEST_SOURCE.
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after
87 } 86 }
88 87
89 main() { 88 main() {
90 var a = Foo.bar(); 89 var a = Foo.bar();
91 var b = new Foo.bar(); 90 var b = new Foo.bar();
92 } 91 }
93 """, 92 """,
94 // TODO(ahe): Why isn't this 'part.dart'? Why the leading slash? 93 // TODO(ahe): Why isn't this 'part.dart'? Why the leading slash?
95 '/part.dart': '', 94 '/part.dart': '',
96 }; 95 };
OLDNEW
« no previous file with comments | « tests/compiler/dart2js/dart_backend_test.dart ('k') | tests/compiler/dart2js/field_type_inferer_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698