| 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/generated/ast.dart'; | 7 import 'package:analyzer/src/generated/ast.dart'; |
| 8 import 'package:analyzer/src/generated/element.dart'; | 8 import 'package:analyzer/src/generated/element.dart'; |
| 9 import 'package:analyzer/src/generated/engine.dart'; | 9 import 'package:analyzer/src/generated/engine.dart'; |
| 10 import 'package:analyzer/src/generated/error.dart'; | 10 import 'package:analyzer/src/generated/error.dart'; |
| (...skipping 2032 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2043 }''', false); | 2043 }''', false); |
| 2044 } else { | 2044 } else { |
| 2045 _updateAndValidate(r''' | 2045 _updateAndValidate(r''' |
| 2046 main() { | 2046 main() { |
| 2047 print(1); | 2047 print(1); |
| 2048 }''', false); | 2048 }''', false); |
| 2049 } | 2049 } |
| 2050 } | 2050 } |
| 2051 } | 2051 } |
| 2052 | 2052 |
| 2053 void test_true_wholeConstructor() { |
| 2054 _resolveUnit(r''' |
| 2055 class A { |
| 2056 A(int a) { |
| 2057 print(a); |
| 2058 } |
| 2059 } |
| 2060 '''); |
| 2061 _updateAndValidate(r''' |
| 2062 class A { |
| 2063 A(int b) { |
| 2064 print(b); |
| 2065 } |
| 2066 } |
| 2067 '''); |
| 2068 } |
| 2069 |
| 2070 void test_true_wholeConstructor_addInitializer() { |
| 2071 _resolveUnit(r''' |
| 2072 class A { |
| 2073 int field; |
| 2074 A(); |
| 2075 } |
| 2076 '''); |
| 2077 _updateAndValidate(r''' |
| 2078 class A { |
| 2079 int field; |
| 2080 A() : field = 5; |
| 2081 } |
| 2082 '''); |
| 2083 } |
| 2084 |
| 2085 void test_true_wholeFunction() { |
| 2086 _resolveUnit(r''' |
| 2087 foo() {} |
| 2088 main(int a) { |
| 2089 print(a); |
| 2090 } |
| 2091 '''); |
| 2092 _updateAndValidate(r''' |
| 2093 foo() {} |
| 2094 main(int b) { |
| 2095 print(b); |
| 2096 } |
| 2097 '''); |
| 2098 } |
| 2099 |
| 2100 void test_true_wholeFunction_firstTokenInUnit() { |
| 2101 _resolveUnit(r''' |
| 2102 main(int a) { |
| 2103 print(a); |
| 2104 } |
| 2105 '''); |
| 2106 _updateAndValidate(r''' |
| 2107 main(int b) { |
| 2108 print(b); |
| 2109 } |
| 2110 '''); |
| 2111 } |
| 2112 |
| 2113 void test_true_wholeMethod() { |
| 2114 _resolveUnit(r''' |
| 2115 class A { |
| 2116 main(int a) { |
| 2117 print(a); |
| 2118 } |
| 2119 } |
| 2120 '''); |
| 2121 _updateAndValidate(r''' |
| 2122 class A { |
| 2123 main(int b) { |
| 2124 print(b); |
| 2125 } |
| 2126 } |
| 2127 '''); |
| 2128 } |
| 2129 |
| 2053 void test_updateErrors_addNew_hints() { | 2130 void test_updateErrors_addNew_hints() { |
| 2054 _resolveUnit(r''' | 2131 _resolveUnit(r''' |
| 2055 main() { | 2132 main() { |
| 2056 int v = 0; | 2133 int v = 0; |
| 2057 print(v); | 2134 print(v); |
| 2058 } | 2135 } |
| 2059 '''); | 2136 '''); |
| 2060 _updateAndValidate(r''' | 2137 _updateAndValidate(r''' |
| 2061 main() { | 2138 main() { |
| 2062 int v = 0; | 2139 int v = 0; |
| (...skipping 1272 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3335 _visitList(node.metadata, other.metadata); | 3412 _visitList(node.metadata, other.metadata); |
| 3336 _visitNode(node.identifier, other.identifier); | 3413 _visitNode(node.identifier, other.identifier); |
| 3337 } | 3414 } |
| 3338 | 3415 |
| 3339 static void assertSameResolution(CompilationUnit actual, | 3416 static void assertSameResolution(CompilationUnit actual, |
| 3340 CompilationUnit expected) { | 3417 CompilationUnit expected) { |
| 3341 _SameResolutionValidator validator = new _SameResolutionValidator(expected); | 3418 _SameResolutionValidator validator = new _SameResolutionValidator(expected); |
| 3342 actual.accept(validator); | 3419 actual.accept(validator); |
| 3343 } | 3420 } |
| 3344 } | 3421 } |
| OLD | NEW |