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.occurrences; | 5 library test.analysis.notification.occurrences; |
6 | 6 |
7 import 'dart:async'; | 7 import 'dart:async'; |
8 | 8 |
9 import 'package:analysis_server/protocol/protocol.dart'; | 9 import 'package:analysis_server/protocol/protocol.dart'; |
10 import 'package:analysis_server/protocol/protocol_generated.dart'; | 10 import 'package:analysis_server/protocol/protocol_generated.dart'; |
11 import 'package:analysis_server/src/constants.dart'; | 11 import 'package:analysis_server/src/constants.dart'; |
12 import 'package:test/test.dart'; | 12 import 'package:test/test.dart'; |
13 import 'package:test_reflective_loader/test_reflective_loader.dart'; | 13 import 'package:test_reflective_loader/test_reflective_loader.dart'; |
14 | 14 |
15 import '../analysis_abstract.dart'; | 15 import '../analysis_abstract.dart'; |
16 | 16 |
17 main() { | 17 main() { |
18 defineReflectiveSuite(() { | 18 defineReflectiveSuite(() { |
19 defineReflectiveTests(AnalysisNotificationOccurrencesTest); | 19 defineReflectiveTests(AnalysisNotificationOccurrencesTest); |
20 }); | 20 }); |
21 } | 21 } |
22 | 22 |
23 @reflectiveTest | 23 @reflectiveTest |
24 class AnalysisNotificationOccurrencesTest extends AbstractAnalysisTest { | 24 class AnalysisNotificationOccurrencesTest extends AbstractAnalysisTest { |
25 List<Occurrences> occurrencesList; | 25 List<Occurrences> occurrencesList; |
26 Occurrences testOccurrences; | 26 Occurrences testOccurrences; |
27 | 27 |
| 28 @override |
| 29 bool get enableNewAnalysisDriver => false; |
| 30 |
28 /** | 31 /** |
29 * Asserts that there is an offset of [search] in [testOccurrences]. | 32 * Asserts that there is an offset of [search] in [testOccurrences]. |
30 */ | 33 */ |
31 void assertHasOffset(String search) { | 34 void assertHasOffset(String search) { |
32 int offset = findOffset(search); | 35 int offset = findOffset(search); |
33 expect(testOccurrences.offsets, contains(offset)); | 36 expect(testOccurrences.offsets, contains(offset)); |
34 } | 37 } |
35 | 38 |
36 /** | 39 /** |
37 * Validates that there is a region at the offset of [search] in [testFile]. | 40 * Validates that there is a region at the offset of [search] in [testFile]. |
(...skipping 208 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
246 test_type_void() async { | 249 test_type_void() async { |
247 addTestFile(''' | 250 addTestFile(''' |
248 void main() { | 251 void main() { |
249 } | 252 } |
250 '''); | 253 '''); |
251 await prepareOccurrences(); | 254 await prepareOccurrences(); |
252 int offset = findOffset('void main()'); | 255 int offset = findOffset('void main()'); |
253 findRegion(offset, 'void'.length, false); | 256 findRegion(offset, 'void'.length, false); |
254 } | 257 } |
255 } | 258 } |
OLD | NEW |