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

Unified Diff: editor/tools/plugins/com.google.dart.engine_test/src/com/google/dart/engine/resolver/StaticWarningCodeTest.java

Issue 15004020: Report StaticWarningCode.IMPORT_DUPLICATED_LIBRARY_NAME (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Use multiline test sources Created 7 years, 7 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 side-by-side diff with in-line comments
Download patch
Index: editor/tools/plugins/com.google.dart.engine_test/src/com/google/dart/engine/resolver/StaticWarningCodeTest.java
diff --git a/editor/tools/plugins/com.google.dart.engine_test/src/com/google/dart/engine/resolver/StaticWarningCodeTest.java b/editor/tools/plugins/com.google.dart.engine_test/src/com/google/dart/engine/resolver/StaticWarningCodeTest.java
index cf959df898b60125b8e762debb75e814dddc5e24..795a6f6d39ad38e4b4da6c8b89a9188454b50d98 100644
--- a/editor/tools/plugins/com.google.dart.engine_test/src/com/google/dart/engine/resolver/StaticWarningCodeTest.java
+++ b/editor/tools/plugins/com.google.dart.engine_test/src/com/google/dart/engine/resolver/StaticWarningCodeTest.java
@@ -423,8 +423,12 @@ public class StaticWarningCodeTest extends ResolverTestCase {
" N m() {}",
"}",
"class B<T extends N> {}"));
- addSource("/lib1.dart", "class N {}");
- addSource("/lib2.dart", "class N {}");
+ addSource("/lib1.dart", createSource(//
+ "library lib1;",
+ "class N {}"));
+ addSource("/lib2.dart", createSource(//
+ "library lib2;",
+ "class N {}"));
resolve(source);
assertErrors(
StaticWarningCode.AMBIGUOUS_IMPORT,
@@ -442,8 +446,12 @@ public class StaticWarningCodeTest extends ResolverTestCase {
"import 'lib2.dart';",
"class A<T> {}",
"A<N> f() {}"));
- addSource("/lib1.dart", "class N {}");
- addSource("/lib2.dart", "class N {}");
+ addSource("/lib1.dart", createSource(//
+ "library lib1;",
+ "class N {}"));
+ addSource("/lib2.dart", createSource(//
+ "library lib2;",
+ "class N {}"));
resolve(source);
assertErrors(StaticWarningCode.AMBIGUOUS_IMPORT);
}
@@ -552,6 +560,18 @@ public class StaticWarningCodeTest extends ResolverTestCase {
verify(source);
}
+ public void test_importDuplicatedLibraryName() throws Exception {
+ Source source = addSource(createSource(//
+ "library test;",
+ "import 'lib1.dart';",
+ "import 'lib2.dart';"));
+ addSource("/lib1.dart", "library lib;");
+ addSource("/lib2.dart", "library lib;");
+ resolve(source);
+ assertErrors(StaticWarningCode.IMPORT_DUPLICATED_LIBRARY_NAME);
+ verify(source);
+ }
+
public void test_newWithAbstractClass() throws Exception {
Source source = addSource(createSource(//
"abstract class A {}",

Powered by Google App Engine
This is Rietveld 408576698