| Index: pkg/analyzer/test/src/context/context_test.dart
|
| diff --git a/pkg/analyzer/test/src/context/context_test.dart b/pkg/analyzer/test/src/context/context_test.dart
|
| index 4166de143821ffcaa35952a6c824f7eef287d228..c8395bb21744b2821426826e482e14cbb5105682 100644
|
| --- a/pkg/analyzer/test/src/context/context_test.dart
|
| +++ b/pkg/analyzer/test/src/context/context_test.dart
|
| @@ -346,46 +346,46 @@ int b = aa;''';
|
| if (context != null) return;
|
| throw 'is this test used by the new analysis driver?';
|
|
|
| - context.analysisOptions = new AnalysisOptionsImpl()..incremental = true;
|
| - Source source = addSource(
|
| - "/test.dart",
|
| - r'''
|
| -main() {
|
| - print(42);
|
| -}
|
| -''');
|
| - _performPendingAnalysisTasks();
|
| - expect(context.getErrors(source).errors, hasLength(0));
|
| - // Update the source to have a parse error.
|
| - // This is an incremental change, but we always invalidate DART_ERRORS.
|
| - context.setContents(
|
| - source,
|
| - r'''
|
| -main() {
|
| - print(42)
|
| -}
|
| -''');
|
| - AnalysisCache cache = context.analysisCache;
|
| - expect(cache.getValue(source, PARSE_ERRORS), hasLength(1));
|
| - expect(cache.getState(source, DART_ERRORS), CacheState.INVALID);
|
| - // Perform enough analysis to prepare inputs (is not actually tested) for
|
| - // the DART_ERRORS computing task, but don't compute it yet.
|
| - context.performAnalysisTask();
|
| - context.performAnalysisTask();
|
| - expect(cache.getState(source, DART_ERRORS), CacheState.INVALID);
|
| - // Update the source so that PARSE_ERRORS is empty.
|
| - context.setContents(
|
| - source,
|
| - r'''
|
| -main() {
|
| - print(42);
|
| -}
|
| -''');
|
| - expect(cache.getValue(source, PARSE_ERRORS), hasLength(0));
|
| - // After full analysis DART_ERRORS should also be empty.
|
| - _performPendingAnalysisTasks();
|
| - expect(cache.getValue(source, DART_ERRORS), hasLength(0));
|
| - expect(context.getErrors(source).errors, hasLength(0));
|
| +// context.analysisOptions = new AnalysisOptionsImpl()..incremental = true;
|
| +// Source source = addSource(
|
| +// "/test.dart",
|
| +// r'''
|
| +//main() {
|
| +// print(42);
|
| +//}
|
| +//''');
|
| +// _performPendingAnalysisTasks();
|
| +// expect(context.getErrors(source).errors, hasLength(0));
|
| +// // Update the source to have a parse error.
|
| +// // This is an incremental change, but we always invalidate DART_ERRORS.
|
| +// context.setContents(
|
| +// source,
|
| +// r'''
|
| +//main() {
|
| +// print(42)
|
| +//}
|
| +//''');
|
| +// AnalysisCache cache = context.analysisCache;
|
| +// expect(cache.getValue(source, PARSE_ERRORS), hasLength(1));
|
| +// expect(cache.getState(source, DART_ERRORS), CacheState.INVALID);
|
| +// // Perform enough analysis to prepare inputs (is not actually tested) for
|
| +// // the DART_ERRORS computing task, but don't compute it yet.
|
| +// context.performAnalysisTask();
|
| +// context.performAnalysisTask();
|
| +// expect(cache.getState(source, DART_ERRORS), CacheState.INVALID);
|
| +// // Update the source so that PARSE_ERRORS is empty.
|
| +// context.setContents(
|
| +// source,
|
| +// r'''
|
| +//main() {
|
| +// print(42);
|
| +//}
|
| +//''');
|
| +// expect(cache.getValue(source, PARSE_ERRORS), hasLength(0));
|
| +// // After full analysis DART_ERRORS should also be empty.
|
| +// _performPendingAnalysisTasks();
|
| +// expect(cache.getValue(source, DART_ERRORS), hasLength(0));
|
| +// expect(context.getErrors(source).errors, hasLength(0));
|
| }
|
|
|
| void test_applyChanges_overriddenSource() {
|
| @@ -481,35 +481,35 @@ import 'libB.dart';''';
|
| if (context != null) return;
|
| throw 'is this test used by the new analysis driver?';
|
|
|
| - MemoryResourceProvider resourceProvider = new MemoryResourceProvider();
|
| - Source source = resourceProvider
|
| - .newFile(
|
| - '/test.dart',
|
| - r'''
|
| -main() {
|
| - print(1);
|
| -}
|
| -''')
|
| - .createSource();
|
| - context.analysisOptions = new AnalysisOptionsImpl()..incremental = true;
|
| - context.applyChanges(new ChangeSet()..addedSource(source));
|
| - // remember compilation unit
|
| - _analyzeAll_assertFinished();
|
| - CompilationUnit unit = context.getResolvedCompilationUnit2(source, source);
|
| - // add overlay
|
| - context.setContents(
|
| - source,
|
| - r'''
|
| -main() {
|
| - print(12);
|
| -}
|
| -''');
|
| - _analyzeAll_assertFinished();
|
| - expect(context.getResolvedCompilationUnit2(source, source), unit);
|
| - // remove overlay
|
| - context.setContents(source, null);
|
| - _analyzeAll_assertFinished();
|
| - expect(context.getResolvedCompilationUnit2(source, source), unit);
|
| +// MemoryResourceProvider resourceProvider = new MemoryResourceProvider();
|
| +// Source source = resourceProvider
|
| +// .newFile(
|
| +// '/test.dart',
|
| +// r'''
|
| +//main() {
|
| +// print(1);
|
| +//}
|
| +//''')
|
| +// .createSource();
|
| +// context.analysisOptions = new AnalysisOptionsImpl()..incremental = true;
|
| +// context.applyChanges(new ChangeSet()..addedSource(source));
|
| +// // remember compilation unit
|
| +// _analyzeAll_assertFinished();
|
| +// CompilationUnit unit = context.getResolvedCompilationUnit2(source, source);
|
| +// // add overlay
|
| +// context.setContents(
|
| +// source,
|
| +// r'''
|
| +//main() {
|
| +// print(12);
|
| +//}
|
| +//''');
|
| +// _analyzeAll_assertFinished();
|
| +// expect(context.getResolvedCompilationUnit2(source, source), unit);
|
| +// // remove overlay
|
| +// context.setContents(source, null);
|
| +// _analyzeAll_assertFinished();
|
| +// expect(context.getResolvedCompilationUnit2(source, source), unit);
|
| }
|
|
|
| Future test_applyChanges_removeContainer() {
|
| @@ -2782,16 +2782,16 @@ int aa = 0;''';
|
| if (context != null) return;
|
| throw 'is this test used by the new analysis driver?';
|
|
|
| - Source librarySource = addSource(
|
| - "/lib.dart",
|
| - r'''
|
| -library lib;
|
| -int a = 0;''');
|
| - context.setContents(librarySource, '// different');
|
| - context.computeLibraryElement(librarySource);
|
| - context.setContents(librarySource, null);
|
| - expect(context.getResolvedCompilationUnit2(librarySource, librarySource),
|
| - isNull);
|
| +// Source librarySource = addSource(
|
| +// "/lib.dart",
|
| +// r'''
|
| +//library lib;
|
| +//int a = 0;''');
|
| +// context.setContents(librarySource, '// different');
|
| +// context.computeLibraryElement(librarySource);
|
| +// context.setContents(librarySource, null);
|
| +// expect(context.getResolvedCompilationUnit2(librarySource, librarySource),
|
| +// isNull);
|
| }
|
|
|
| void test_setContents_unchanged_consistentModificationTime() {
|
|
|