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

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

Issue 21544003: Handle missing imports/exports/parts. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years, 4 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
(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 // Test that the compiler can handle imports when package root has not been set.
6
7 library dart2js.test.import;
8
9 import 'package:expect/expect.dart';
10 import 'memory_compiler.dart';
11
12 const MEMORY_SOURCE_FILES = const {
13 'main.dart': '''
14
15 library main;
16
17 import 'dart:bar';
ahe 2013/08/06 15:01:00 The comment on line 5 implies that you meant packa
Johnni Winther 2013/08/19 08:05:19 Done.
18 export 'foo.dart';
19
20 part 'bar.dart';
21
22 main() {
23 int i = "";
24 }
25 ''',
26 };
27
28 testMissingImports() {
29 var collector = new DiagnosticCollector();
30 var compiler = compilerFor(MEMORY_SOURCE_FILES, diagnosticHandler: collector);
31 compiler.run(Uri.parse('memory:main.dart'));
32 Expect.equals(3, collector.errors.length);
33 Expect.equals(1, collector.warnings.length);
34 }
35
36 testMissingMain() {
37 var collector = new DiagnosticCollector();
38 var compiler = compilerFor({}, diagnosticHandler: collector);
39 compiler.run(Uri.parse('memory:missing.dart'));
40 Expect.equals(1, collector.errors.length);
41 Expect.equals(0, collector.warnings.length);
42 }
43
44 void main() {
45 testMissingImports();
46 testMissingMain();
47 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698