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

Side by Side Diff: pkg/analyzer/test/src/context/cache_test.dart

Issue 1339603004: Tweak for incremental result updates. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 5 years, 3 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 unified diff | Download patch
« no previous file with comments | « pkg/analyzer/lib/src/context/cache.dart ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 library test.src.task.driver_test; 5 library test.src.task.driver_test;
6 6
7 import 'package:analyzer/src/context/cache.dart'; 7 import 'package:analyzer/src/context/cache.dart';
8 import 'package:analyzer/src/generated/engine.dart' 8 import 'package:analyzer/src/generated/engine.dart'
9 show 9 show
10 AnalysisContext, 10 AnalysisContext,
(...skipping 727 matching lines...) Expand 10 before | Expand all | Expand 10 after
738 expect(entry.getValue(result2), 222); 738 expect(entry.getValue(result2), 222);
739 expect(entry.getValue(result3), 333); 739 expect(entry.getValue(result3), 333);
740 // replace result1, keep "dependedOn", invalidate result3 740 // replace result1, keep "dependedOn", invalidate result3
741 entry.setValueIncremental(result2, 2222); 741 entry.setValueIncremental(result2, 2222);
742 expect(entry.getState(result1), CacheState.VALID); 742 expect(entry.getState(result1), CacheState.VALID);
743 expect(entry.getState(result2), CacheState.VALID); 743 expect(entry.getState(result2), CacheState.VALID);
744 expect(entry.getState(result3), CacheState.INVALID); 744 expect(entry.getState(result3), CacheState.INVALID);
745 expect(entry.getValue(result1), 111); 745 expect(entry.getValue(result1), 111);
746 expect(entry.getValue(result2), 2222); 746 expect(entry.getValue(result2), 2222);
747 expect(entry.getValue(result3), -3); 747 expect(entry.getValue(result3), -3);
748 expect(entry.getResultData(result1).dependentResults,
749 unorderedEquals([new TargetedResult(target, result2)]));
748 expect(entry.getResultData(result2).dependedOnResults, 750 expect(entry.getResultData(result2).dependedOnResults,
749 unorderedEquals([new TargetedResult(target, result1)])); 751 unorderedEquals([new TargetedResult(target, result1)]));
750 } 752 }
751 753
752 test_toString_empty() { 754 test_toString_empty() {
753 AnalysisTarget target = new TestSource(); 755 AnalysisTarget target = new TestSource();
754 CacheEntry entry = new CacheEntry(target); 756 CacheEntry entry = new CacheEntry(target);
755 expect(entry.toString(), isNotNull); 757 expect(entry.toString(), isNotNull);
756 } 758 }
757 759
(...skipping 347 matching lines...) Expand 10 before | Expand all | Expand 10 after
1105 return DeltaResult.KEEP_CONTINUE; 1107 return DeltaResult.KEEP_CONTINUE;
1106 } 1108 }
1107 return DeltaResult.INVALIDATE; 1109 return DeltaResult.INVALIDATE;
1108 } 1110 }
1109 } 1111 }
1110 1112
1111 class _TestAnalysisTarget implements AnalysisTarget { 1113 class _TestAnalysisTarget implements AnalysisTarget {
1112 @override 1114 @override
1113 Source get source => null; 1115 Source get source => null;
1114 } 1116 }
OLDNEW
« no previous file with comments | « pkg/analyzer/lib/src/context/cache.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698