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

Unified Diff: pkg/analyzer/test/src/task/dart_test.dart

Issue 1012543002: Include the common library name used in 'part of' directives. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 5 years, 9 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
« pkg/analyzer/lib/src/task/dart.dart ('K') | « pkg/analyzer/lib/src/task/dart.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/src/task/dart_test.dart
diff --git a/pkg/analyzer/test/src/task/dart_test.dart b/pkg/analyzer/test/src/task/dart_test.dart
index 7bc11f51763aa25410ba61a396f5f6636e32a83e..42484bd8973bc3514833a9e8155b1c52946bb9fd 100644
--- a/pkg/analyzer/test/src/task/dart_test.dart
+++ b/pkg/analyzer/test/src/task/dart_test.dart
@@ -555,17 +555,42 @@ part of lib;
}
}
- test_perform_error_missingLibraryDirectiveWithPart() {
+ test_perform_error_missingLibraryDirectiveWithPart_hasCommon() {
_performBuildTask({
'/lib.dart': '''
-part 'part.dart';
+part 'partA.dart';
+part 'partB.dart';
''',
- '/part.dart': '''
-part of lib;
+ '/partA.dart': '''
+part of my_lib;
+ ''',
+ '/partB.dart': '''
+part of my_lib;
+'''
+ });
+ _assertErrorsWithCodes(
+ [ResolverErrorCode.MISSING_LIBRARY_DIRECTIVE_WITH_PART]);
+ AnalysisErrorWithProperties error = errorListener.errors[0];
Brian Wilkerson 2015/03/15 23:28:14 "AnalysisErrorWithProperties" --> "AnalysisError"
scheglov 2015/03/15 23:38:15 Done.
+ expect(error.getProperty(ErrorProperty.PARTS_LIBRARY_NAME), 'my_lib');
+ }
+
+ test_perform_error_missingLibraryDirectiveWithPart_noCommon() {
+ _performBuildTask({
+ '/lib.dart': '''
+part 'partA.dart';
+part 'partB.dart';
+''',
+ '/partA.dart': '''
+part of libA;
+ ''',
+ '/partB.dart': '''
+part of libB;
'''
});
_assertErrorsWithCodes(
[ResolverErrorCode.MISSING_LIBRARY_DIRECTIVE_WITH_PART]);
+ AnalysisErrorWithProperties error = errorListener.errors[0];
Brian Wilkerson 2015/03/15 23:28:14 "AnalysisErrorWithProperties" --> "AnalysisError"
scheglov 2015/03/15 23:38:15 Done.
+ expect(error.getProperty(ErrorProperty.PARTS_LIBRARY_NAME), isNull);
}
test_perform_error_partOfDifferentLibrary() {
« pkg/analyzer/lib/src/task/dart.dart ('K') | « pkg/analyzer/lib/src/task/dart.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698