OLD | NEW |
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 720 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
731 entry.setValue(result1, 111, TargetedResult.EMPTY_LIST); | 731 entry.setValue(result1, 111, TargetedResult.EMPTY_LIST); |
732 entry.setValue(result2, 222, [new TargetedResult(target, result1)]); | 732 entry.setValue(result2, 222, [new TargetedResult(target, result1)]); |
733 entry.setValue(result3, 333, [new TargetedResult(target, result2)]); | 733 entry.setValue(result3, 333, [new TargetedResult(target, result2)]); |
734 expect(entry.getState(result1), CacheState.VALID); | 734 expect(entry.getState(result1), CacheState.VALID); |
735 expect(entry.getState(result2), CacheState.VALID); | 735 expect(entry.getState(result2), CacheState.VALID); |
736 expect(entry.getState(result3), CacheState.VALID); | 736 expect(entry.getState(result3), CacheState.VALID); |
737 expect(entry.getValue(result1), 111); | 737 expect(entry.getValue(result1), 111); |
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, true); |
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, | 748 expect(entry.getResultData(result1).dependentResults, |
749 unorderedEquals([new TargetedResult(target, result2)])); | 749 unorderedEquals([new TargetedResult(target, result2)])); |
750 expect(entry.getResultData(result2).dependedOnResults, | 750 expect(entry.getResultData(result2).dependedOnResults, |
751 unorderedEquals([new TargetedResult(target, result1)])); | 751 unorderedEquals([new TargetedResult(target, result1)])); |
(...skipping 355 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1107 return DeltaResult.KEEP_CONTINUE; | 1107 return DeltaResult.KEEP_CONTINUE; |
1108 } | 1108 } |
1109 return DeltaResult.INVALIDATE; | 1109 return DeltaResult.INVALIDATE; |
1110 } | 1110 } |
1111 } | 1111 } |
1112 | 1112 |
1113 class _TestAnalysisTarget implements AnalysisTarget { | 1113 class _TestAnalysisTarget implements AnalysisTarget { |
1114 @override | 1114 @override |
1115 Source get source => null; | 1115 Source get source => null; |
1116 } | 1116 } |
OLD | NEW |