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

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

Issue 694353007: Move dart2js from sdk/lib/_internal/compiler to pkg/compiler (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 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
« no previous file with comments | « tests/compiler/dart2js/parser_test.dart ('k') | tests/compiler/dart2js/patch_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 library part_of_test; 5 library part_of_test;
6 6
7 import "package:expect/expect.dart"; 7 import "package:expect/expect.dart";
8 import "package:async_helper/async_helper.dart"; 8 import "package:async_helper/async_helper.dart";
9 import 'mock_compiler.dart'; 9 import 'mock_compiler.dart';
10 import 'package:compiler/implementation/dart2jslib.dart' 10 import 'package:compiler/src/dart2jslib.dart'
11 show MessageKind; 11 show MessageKind;
12 12
13 final libraryUri = Uri.parse('test:library.dart'); 13 final libraryUri = Uri.parse('test:library.dart');
14 const String LIBRARY_SOURCE = ''' 14 const String LIBRARY_SOURCE = '''
15 library foo; 15 library foo;
16 part 'part.dart'; 16 part 'part.dart';
17 '''; 17 ''';
18 18
19 final partUri = Uri.parse('test:part.dart'); 19 final partUri = Uri.parse('test:part.dart');
20 const String PART_SOURCE = ''' 20 const String PART_SOURCE = '''
21 part of bar; 21 part of bar;
22 '''; 22 ''';
23 23
24 void main() { 24 void main() {
25 MockCompiler compiler = new MockCompiler.internal(); 25 MockCompiler compiler = new MockCompiler.internal();
26 compiler.registerSource(libraryUri, LIBRARY_SOURCE); 26 compiler.registerSource(libraryUri, LIBRARY_SOURCE);
27 compiler.registerSource(partUri, PART_SOURCE); 27 compiler.registerSource(partUri, PART_SOURCE);
28 28
29 asyncTest(() => compiler.libraryLoader.loadLibrary(libraryUri).then((_) { 29 asyncTest(() => compiler.libraryLoader.loadLibrary(libraryUri).then((_) {
30 print('errors: ${compiler.errors}'); 30 print('errors: ${compiler.errors}');
31 print('warnings: ${compiler.warnings}'); 31 print('warnings: ${compiler.warnings}');
32 Expect.isTrue(compiler.errors.isEmpty); 32 Expect.isTrue(compiler.errors.isEmpty);
33 Expect.equals(1, compiler.warnings.length); 33 Expect.equals(1, compiler.warnings.length);
34 Expect.equals(MessageKind.LIBRARY_NAME_MISMATCH, 34 Expect.equals(MessageKind.LIBRARY_NAME_MISMATCH,
35 compiler.warnings[0].message.kind); 35 compiler.warnings[0].message.kind);
36 Expect.equals('foo', 36 Expect.equals('foo',
37 compiler.warnings[0].message.arguments['libraryName'].toString()); 37 compiler.warnings[0].message.arguments['libraryName'].toString());
38 })); 38 }));
39 } 39 }
OLDNEW
« no previous file with comments | « tests/compiler/dart2js/parser_test.dart ('k') | tests/compiler/dart2js/patch_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698