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

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: Fixes for review comments. 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
« no previous file with comments | « 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..2ae1a43fd259db4eca3c75b453888315b00019f9 100644
--- a/pkg/analyzer/test/src/task/dart_test.dart
+++ b/pkg/analyzer/test/src/task/dart_test.dart
@@ -385,7 +385,6 @@ enum MyEnum {
CompilationUnit unit = outputs[RESOLVED_UNIT4];
// validate Element
ClassElement enumElement = unit.element.getEnum('MyEnum');
- print(enumElement.fields);
List<FieldElement> fields = enumElement.fields;
expect(fields, hasLength(4));
{
@@ -555,17 +554,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]);
+ AnalysisError error = errorListener.errors[0];
+ 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]);
+ AnalysisError error = errorListener.errors[0];
+ expect(error.getProperty(ErrorProperty.PARTS_LIBRARY_NAME), isNull);
}
test_perform_error_partOfDifferentLibrary() {
« no previous file with comments | « 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