| 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.analysis.notification.navigation; | 5 library test.analysis.notification.navigation; |
| 6 | 6 |
| 7 import 'dart:async'; | 7 import 'dart:async'; |
| 8 | 8 |
| 9 import 'package:analysis_server/src/constants.dart'; | 9 import 'package:analysis_server/src/constants.dart'; |
| 10 import 'package:analysis_server/src/protocol.dart'; | 10 import 'package:analysis_server/src/protocol.dart'; |
| (...skipping 168 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 179 class AAA {} | 179 class AAA {} |
| 180 AAA aaa; | 180 AAA aaa; |
| 181 '''); | 181 '''); |
| 182 return waitForTasksFinished().then((_) { | 182 return waitForTasksFinished().then((_) { |
| 183 return prepareNavigation().then((_) { | 183 return prepareNavigation().then((_) { |
| 184 assertHasRegionTarget('AAA aaa;', 'AAA {}'); | 184 assertHasRegionTarget('AAA aaa;', 'AAA {}'); |
| 185 }); | 185 }); |
| 186 }); | 186 }); |
| 187 } | 187 } |
| 188 | 188 |
| 189 test_class_fromSDK() { |
| 190 addTestFile(''' |
| 191 int V = 42; |
| 192 '''); |
| 193 return prepareNavigation().then((_) { |
| 194 assertHasRegion('int V'); |
| 195 Element target = testTargets[0]; |
| 196 Location location = target.location; |
| 197 expect(location.startLine, greaterThan(0)); |
| 198 expect(location.startColumn, greaterThan(0)); |
| 199 }); |
| 200 } |
| 201 |
| 189 test_constructor_named() { | 202 test_constructor_named() { |
| 190 addTestFile(''' | 203 addTestFile(''' |
| 191 class A { | 204 class A { |
| 192 A.named(BBB p) {} | 205 A.named(BBB p) {} |
| 193 } | 206 } |
| 194 class BBB {} | 207 class BBB {} |
| 195 '''); | 208 '''); |
| 196 return prepareNavigation().then((_) { | 209 return prepareNavigation().then((_) { |
| 197 // has region for complete "A.named" | 210 // has region for complete "A.named" |
| 198 assertHasRegionString('A.named'); | 211 assertHasRegionString('A.named'); |
| (...skipping 299 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 498 test_type_void() { | 511 test_type_void() { |
| 499 addTestFile(''' | 512 addTestFile(''' |
| 500 void main() { | 513 void main() { |
| 501 } | 514 } |
| 502 '''); | 515 '''); |
| 503 return prepareNavigation().then((_) { | 516 return prepareNavigation().then((_) { |
| 504 assertNoRegionAt('void'); | 517 assertNoRegionAt('void'); |
| 505 }); | 518 }); |
| 506 } | 519 } |
| 507 } | 520 } |
| OLD | NEW |