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

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

Issue 683673004: Fix issue 21379 (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 years, 2 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/generated/engine.dart ('k') | pkg/analyzer/test/generated/resolver_test.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/analyzer/test/generated/engine_test.dart
diff --git a/pkg/analyzer/test/generated/engine_test.dart b/pkg/analyzer/test/generated/engine_test.dart
index 2b53f84f8696a6a3276566411e12331ec28778c2..7fa5e6eda5e54b4f40c39dca346732dc3a5f8fef 100644
--- a/pkg/analyzer/test/generated/engine_test.dart
+++ b/pkg/analyzer/test/generated/engine_test.dart
@@ -2811,6 +2811,49 @@ class DartEntryTest extends EngineTestCase {
entry.removeResolution(source1);
}
+ void test_resolvableCompilationUnit_builtUnit() {
+ Source librarySource = new TestSource('/lib.dart');
+ CompilationUnit unit = AstFactory.compilationUnit();
+ CompilationUnitElement element = ElementFactory.compilationUnit('test.dart');
+ unit.element = element;
+ DartEntry entry = new DartEntry();
+ entry.setState(DartEntry.PARSED_UNIT, CacheState.FLUSHED);
+ entry.setValueInLibrary(DartEntry.BUILT_UNIT, librarySource, unit);
+ entry.invalidateAllResolutionInformation(false);
+ CompilationUnit resolvableUnit = entry.resolvableCompilationUnit;
+ expect(resolvableUnit, isNotNull);
+ expect(resolvableUnit.element, isNull);
+ expect(entry.resolvableCompilationUnit, isNull);
+ }
+
+ void test_resolvableCompilationUnit_none() {
+ DartEntry entry = new DartEntry();
+ expect(entry.resolvableCompilationUnit, isNull);
+ }
+
+ void test_resolvableCompilationUnit_parsed() {
+ CompilationUnit unit = AstFactory.compilationUnit();
+ DartEntry entry = new DartEntry();
+ entry.setValue(DartEntry.PARSED_UNIT, unit);
+ expect(entry.resolvableCompilationUnit, unit);
+ expect(entry.resolvableCompilationUnit, isNull);
+ }
+
+ void test_resolvableCompilationUnit_resolved() {
+ Source librarySource = new TestSource('/lib.dart');
+ CompilationUnit unit = AstFactory.compilationUnit();
+ CompilationUnitElement element = ElementFactory.compilationUnit('test.dart');
+ unit.element = element;
+ DartEntry entry = new DartEntry();
+ entry.setState(DartEntry.PARSED_UNIT, CacheState.FLUSHED);
+ entry.setValueInLibrary(DartEntry.RESOLVED_UNIT, librarySource, unit);
+ entry.invalidateAllResolutionInformation(false);
+ CompilationUnit resolvableUnit = entry.resolvableCompilationUnit;
+ expect(resolvableUnit, isNotNull);
+ expect(resolvableUnit.element, isNull);
+ expect(entry.resolvableCompilationUnit, isNull);
+ }
+
void test_setState_element() {
_setState(DartEntry.ELEMENT);
}
« no previous file with comments | « pkg/analyzer/lib/src/generated/engine.dart ('k') | pkg/analyzer/test/generated/resolver_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698