OLD | NEW |
1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2014, 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.context.context_test; | 5 library test.src.context.context_test; |
6 | 6 |
7 import 'dart:async'; | 7 import 'dart:async'; |
8 | 8 |
9 import 'package:analyzer/file_system/memory_file_system.dart'; | 9 import 'package:analyzer/file_system/memory_file_system.dart'; |
10 import 'package:analyzer/src/cancelable_future.dart'; | 10 import 'package:analyzer/src/cancelable_future.dart'; |
(...skipping 1482 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1493 expect(context.getResolvedCompilationUnit2(partSource, libSource), isNull, | 1493 expect(context.getResolvedCompilationUnit2(partSource, libSource), isNull, |
1494 reason: "part resolved 2"); | 1494 reason: "part resolved 2"); |
1495 // update and analyze #2 | 1495 // update and analyze #2 |
1496 context.setContents(libSource, "library lib; part 'test-part.dart';"); | 1496 context.setContents(libSource, "library lib; part 'test-part.dart';"); |
1497 expect(context.getResolvedCompilationUnit2(libSource, libSource), isNull, | 1497 expect(context.getResolvedCompilationUnit2(libSource, libSource), isNull, |
1498 reason: "library changed 3"); | 1498 reason: "library changed 3"); |
1499 expect(context.getResolvedCompilationUnit2(partSource, libSource), isNull, | 1499 expect(context.getResolvedCompilationUnit2(partSource, libSource), isNull, |
1500 reason: "part changed 3"); | 1500 reason: "part changed 3"); |
1501 _analyzeAll_assertFinished(); | 1501 _analyzeAll_assertFinished(); |
1502 expect(context.getResolvedCompilationUnit2(libSource, libSource), isNotNull, | 1502 expect(context.getResolvedCompilationUnit2(libSource, libSource), isNotNull, |
1503 reason: "library resolved 2"); | 1503 reason: "library resolved 3"); |
1504 expect( | 1504 expect( |
1505 context.getResolvedCompilationUnit2(partSource, libSource), isNotNull, | 1505 context.getResolvedCompilationUnit2(partSource, libSource), isNotNull, |
1506 reason: "part resolved 3"); | 1506 reason: "part resolved 3"); |
1507 } | 1507 } |
1508 | 1508 |
1509 void test_performAnalysisTask_changeLibraryThenPartContents() { | 1509 void test_performAnalysisTask_changeLibraryThenPartContents() { |
1510 Source libSource = | 1510 Source libSource = |
1511 addSource("/test.dart", "library lib; part 'test-part.dart';"); | 1511 addSource("/test.dart", "library lib; part 'test-part.dart';"); |
1512 Source partSource = addSource("/test-part.dart", "part of lib;"); | 1512 Source partSource = addSource("/test-part.dart", "part of lib;"); |
1513 _analyzeAll_assertFinished(); | 1513 _analyzeAll_assertFinished(); |
(...skipping 1001 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2515 } | 2515 } |
2516 } | 2516 } |
2517 | 2517 |
2518 class _AnalysisContextImplTest_test_applyChanges_removeContainer | 2518 class _AnalysisContextImplTest_test_applyChanges_removeContainer |
2519 implements SourceContainer { | 2519 implements SourceContainer { |
2520 Source libB; | 2520 Source libB; |
2521 _AnalysisContextImplTest_test_applyChanges_removeContainer(this.libB); | 2521 _AnalysisContextImplTest_test_applyChanges_removeContainer(this.libB); |
2522 @override | 2522 @override |
2523 bool contains(Source source) => source == libB; | 2523 bool contains(Source source) => source == libB; |
2524 } | 2524 } |
OLD | NEW |