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

Unified Diff: pkg/analyzer/test/generated/static_warning_code_test.dart

Issue 712663002: Fix for issue 20125 - improved error messages (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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « pkg/analyzer/lib/src/generated/error_verifier.dart ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/analyzer/test/generated/static_warning_code_test.dart
diff --git a/pkg/analyzer/test/generated/static_warning_code_test.dart b/pkg/analyzer/test/generated/static_warning_code_test.dart
index 4164beb8b1c0ed26d4a795b279dd83c0cb27ba0a..127654a623197b42e4f4a7939476437d93c0ba70 100644
--- a/pkg/analyzer/test/generated/static_warning_code_test.dart
+++ b/pkg/analyzer/test/generated/static_warning_code_test.dart
@@ -1116,7 +1116,7 @@ var m = {const A<int>(): 0, const A<num>(): 1};''');
verify([source]);
}
- void test_exportDuplicatedLibraryName() {
+ void test_exportDuplicatedLibraryNamed() {
Source source = addSource(r'''
library test;
export 'lib1.dart';
@@ -1124,7 +1124,19 @@ export 'lib2.dart';''');
addNamedSource("/lib1.dart", "library lib;");
addNamedSource("/lib2.dart", "library lib;");
resolve(source);
- assertErrors(source, [StaticWarningCode.EXPORT_DUPLICATED_LIBRARY_NAME]);
+ assertErrors(source, [StaticWarningCode.EXPORT_DUPLICATED_LIBRARY_NAMED]);
+ verify([source]);
+ }
+
+ void test_exportDuplicatedLibraryUnnamed() {
+ Source source = addSource(r'''
+library test;
+export 'lib1.dart';
+export 'lib2.dart';''');
+ addNamedSource("/lib1.dart", "");
+ addNamedSource("/lib2.dart", "");
+ resolve(source);
+ assertErrors(source, [StaticWarningCode.EXPORT_DUPLICATED_LIBRARY_UNNAMED]);
verify([source]);
}
@@ -1292,7 +1304,7 @@ class B implements A {
verify([source]);
}
- void test_importDuplicatedLibraryName() {
+ void test_importDuplicatedLibraryNamed() {
Source source = addSource(r'''
library test;
import 'lib1.dart';
@@ -1301,7 +1313,22 @@ import 'lib2.dart';''');
addNamedSource("/lib2.dart", "library lib;");
resolve(source);
assertErrors(source, [
- StaticWarningCode.IMPORT_DUPLICATED_LIBRARY_NAME,
+ StaticWarningCode.IMPORT_DUPLICATED_LIBRARY_NAMED,
+ HintCode.UNUSED_IMPORT,
+ HintCode.UNUSED_IMPORT]);
+ verify([source]);
+ }
+
+ void test_importDuplicatedLibraryUnnamed() {
+ Source source = addSource(r'''
+library test;
+import 'lib1.dart';
+import 'lib2.dart';''');
+ addNamedSource("/lib1.dart", "");
+ addNamedSource("/lib2.dart", "");
+ resolve(source);
+ assertErrors(source, [
+ StaticWarningCode.IMPORT_DUPLICATED_LIBRARY_UNNAMED,
HintCode.UNUSED_IMPORT,
HintCode.UNUSED_IMPORT]);
verify([source]);
« no previous file with comments | « pkg/analyzer/lib/src/generated/error_verifier.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698