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 analyzer.test.src.task.dart_work_manager_test; | 5 library analyzer.test.src.task.dart_work_manager_test; |
6 | 6 |
7 import 'package:analyzer/dart/ast/ast.dart'; | 7 import 'package:analyzer/dart/ast/ast.dart'; |
8 import 'package:analyzer/src/context/cache.dart'; | 8 import 'package:analyzer/src/context/cache.dart'; |
9 import 'package:analyzer/src/dart/scanner/scanner.dart' show ScannerErrorCode; | 9 import 'package:analyzer/src/dart/scanner/scanner.dart' show ScannerErrorCode; |
10 import 'package:analyzer/src/generated/engine.dart' | 10 import 'package:analyzer/src/generated/engine.dart' |
(...skipping 311 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
322 new AnalysisError(source1, 1, 0, ScannerErrorCode.MISSING_DIGIT); | 322 new AnalysisError(source1, 1, 0, ScannerErrorCode.MISSING_DIGIT); |
323 AnalysisError error2 = | 323 AnalysisError error2 = |
324 new AnalysisError(source1, 2, 0, ScannerErrorCode.MISSING_DIGIT); | 324 new AnalysisError(source1, 2, 0, ScannerErrorCode.MISSING_DIGIT); |
325 when(context.getLibrariesContaining(source1)).thenReturn([source2]); | 325 when(context.getLibrariesContaining(source1)).thenReturn([source2]); |
326 entry1.setValue(DART_ERRORS, <AnalysisError>[error1, error2], []); | 326 entry1.setValue(DART_ERRORS, <AnalysisError>[error1, error2], []); |
327 List<AnalysisError> errors = manager.getErrors(source1); | 327 List<AnalysisError> errors = manager.getErrors(source1); |
328 expect(errors, unorderedEquals([error1, error2])); | 328 expect(errors, unorderedEquals([error1, error2])); |
329 } | 329 } |
330 | 330 |
331 void test_getLibrariesContainingPart() { | 331 void test_getLibrariesContainingPart() { |
| 332 when(context.aboutToComputeResult(anyObject, anyObject)).thenReturn(false); |
332 Source part1 = new TestSource('part1.dart'); | 333 Source part1 = new TestSource('part1.dart'); |
333 Source part2 = new TestSource('part2.dart'); | 334 Source part2 = new TestSource('part2.dart'); |
334 Source part3 = new TestSource('part3.dart'); | 335 Source part3 = new TestSource('part3.dart'); |
335 Source library1 = new TestSource('library1.dart'); | 336 Source library1 = new TestSource('library1.dart'); |
336 Source library2 = new TestSource('library2.dart'); | 337 Source library2 = new TestSource('library2.dart'); |
337 manager.partLibrariesMap[part1] = [library1, library2]; | 338 manager.partLibrariesMap[part1] = [library1, library2]; |
338 manager.partLibrariesMap[part2] = [library2]; | 339 manager.partLibrariesMap[part2] = [library2]; |
339 manager.libraryPartsMap[library1] = [part1]; | 340 manager.libraryPartsMap[library1] = [part1]; |
340 manager.libraryPartsMap[library2] = [part1, part2]; | 341 manager.libraryPartsMap[library2] = [part1, part2]; |
341 // getLibrariesContainingPart | 342 // getLibrariesContainingPart |
(...skipping 479 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
821 class _SourceFactoryMock extends TypedMock implements SourceFactory {} | 822 class _SourceFactoryMock extends TypedMock implements SourceFactory {} |
822 | 823 |
823 class _SourceMock extends TypedMock implements Source { | 824 class _SourceMock extends TypedMock implements Source { |
824 final String shortName; | 825 final String shortName; |
825 _SourceMock(this.shortName); | 826 _SourceMock(this.shortName); |
826 @override | 827 @override |
827 String get fullName => '/' + shortName; | 828 String get fullName => '/' + shortName; |
828 @override | 829 @override |
829 String toString() => fullName; | 830 String toString() => fullName; |
830 } | 831 } |
OLD | NEW |