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 engine.incremental_resolver_test; | 5 library engine.incremental_resolver_test; |
6 | 6 |
7 import 'package:analyzer/src/context/cache.dart' as task; | 7 import 'package:analyzer/src/context/cache.dart' as task; |
8 import 'package:analyzer/src/context/cache.dart'; | 8 import 'package:analyzer/src/context/cache.dart'; |
9 import 'package:analyzer/src/generated/ast.dart'; | 9 import 'package:analyzer/src/generated/ast.dart'; |
10 import 'package:analyzer/src/generated/element.dart'; | 10 import 'package:analyzer/src/generated/element.dart'; |
(...skipping 3503 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3514 _updateAndValidate(r''' | 3514 _updateAndValidate(r''' |
3515 class A { | 3515 class A { |
3516 void foo() {} | 3516 void foo() {} |
3517 void foo2() {} | 3517 void foo2() {} |
3518 } | 3518 } |
3519 '''); | 3519 '''); |
3520 } | 3520 } |
3521 | 3521 |
3522 @override | 3522 @override |
3523 void setUp() { | 3523 void setUp() { |
3524 AnalysisEngine.instance.useTaskModel = true; | |
3525 super.setUp(); | 3524 super.setUp(); |
3526 _resetWithIncremental(true); | 3525 _resetWithIncremental(true); |
3527 } | 3526 } |
3528 | 3527 |
3529 @override | |
3530 void tearDown() { | |
3531 super.tearDown(); | |
3532 AnalysisEngine.instance.useTaskModel = false; | |
3533 } | |
3534 | |
3535 void test_computeConstants() { | 3528 void test_computeConstants() { |
3536 _resolveUnit(r''' | 3529 _resolveUnit(r''' |
3537 int f() => 0; | 3530 int f() => 0; |
3538 main() { | 3531 main() { |
3539 const x = f(); | 3532 const x = f(); |
3540 print(x + 1); | 3533 print(x + 1); |
3541 } | 3534 } |
3542 '''); | 3535 '''); |
3543 _updateAndValidate(r''' | 3536 _updateAndValidate(r''' |
3544 int f() => 0; | 3537 int f() => 0; |
(...skipping 1383 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4928 return ResolutionContextBuilder.contextFor(node, listener).scope; | 4921 return ResolutionContextBuilder.contextFor(node, listener).scope; |
4929 } | 4922 } |
4930 } | 4923 } |
4931 | 4924 |
4932 class _Edit { | 4925 class _Edit { |
4933 final int offset; | 4926 final int offset; |
4934 final int length; | 4927 final int length; |
4935 final String replacement; | 4928 final String replacement; |
4936 _Edit(this.offset, this.length, this.replacement); | 4929 _Edit(this.offset, this.length, this.replacement); |
4937 } | 4930 } |
OLD | NEW |