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

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

Issue 11879039: Fix error message for library name mismatch. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Unittest added. Created 7 years, 11 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 | « tests/compiler/dart2js/mock_compiler.dart ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
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
3 // BSD-style license that can be found in the LICENSE file.
4
5 library part_of_test;
6
7 import 'dart:uri';
8 import 'mock_compiler.dart';
9 import '../../../sdk/lib/_internal/compiler/implementation/dart2jslib.dart'
10 show MessageKind;
11
12 final libraryUri = new Uri('test:library.dart');
13 const String LIBRARY_SOURCE = '''
14 library foo;
15 part 'part.dart';
16 ''';
17
18 final partUri = new Uri('test:part.dart');
19 const String PART_SOURCE = '''
20 part of bar;
21 ''';
22
23 void main() {
24 var compiler = new MockCompiler();
25 compiler.registerSource(libraryUri, LIBRARY_SOURCE);
26 compiler.registerSource(partUri, PART_SOURCE);
27
28 compiler.libraryLoader.loadLibrary(libraryUri, null, libraryUri);
29 print('errors: ${compiler.errors}');
30 print('warnings: ${compiler.warnings}');
31 Expect.isTrue(compiler.errors.isEmpty);
32 Expect.equals(1, compiler.warnings.length);
33 Expect.equals(MessageKind.LIBRARY_NAME_MISMATCH,
34 compiler.warnings[0].message.kind);
35 Expect.equals('Warning: expected part of library name "foo".',
ahe 2013/01/23 11:30:27 Could you obtain this string with: "${MessageKind
Johnni Winther 2013/01/24 13:13:18 Done.
36 compiler.warnings[0].message.toString());
37 }
OLDNEW
« no previous file with comments | « tests/compiler/dart2js/mock_compiler.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698