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.overrides; | |
6 | |
7 import 'dart:async'; | 5 import 'dart:async'; |
8 | 6 |
9 import 'package:analysis_server/protocol/protocol.dart'; | 7 import 'package:analysis_server/protocol/protocol.dart'; |
10 import 'package:analysis_server/protocol/protocol_generated.dart'; | 8 import 'package:analysis_server/protocol/protocol_generated.dart'; |
11 import 'package:analysis_server/src/constants.dart'; | 9 import 'package:analysis_server/src/constants.dart'; |
12 import 'package:test/test.dart'; | 10 import 'package:test/test.dart'; |
13 import 'package:test_reflective_loader/test_reflective_loader.dart'; | 11 import 'package:test_reflective_loader/test_reflective_loader.dart'; |
14 | 12 |
15 import '../analysis_abstract.dart'; | 13 import '../analysis_abstract.dart'; |
16 | 14 |
17 main() { | 15 main() { |
18 defineReflectiveSuite(() { | 16 defineReflectiveSuite(() { |
19 defineReflectiveTests(AnalysisNotificationOverridesTest); | 17 defineReflectiveTests(AnalysisNotificationOverridesTest); |
20 }); | 18 }); |
21 } | 19 } |
22 | 20 |
23 @reflectiveTest | 21 @reflectiveTest |
24 class AnalysisNotificationOverridesTest extends AbstractAnalysisTest { | 22 class AnalysisNotificationOverridesTest extends AbstractAnalysisTest { |
25 List<Override> overridesList; | 23 List<Override> overridesList; |
26 Override override; | 24 Override override; |
27 | 25 |
28 @override | |
29 bool get enableNewAnalysisDriver => false; | 26 bool get enableNewAnalysisDriver => false; |
30 | 27 |
31 /** | 28 /** |
32 * Asserts that there is an overridden interface [OverriddenMember] at the | 29 * Asserts that there is an overridden interface [OverriddenMember] at the |
33 * offset of [search] in [override]. | 30 * offset of [search] in [override]. |
34 */ | 31 */ |
35 void assertHasInterfaceMember(String search) { | 32 void assertHasInterfaceMember(String search) { |
36 int offset = findOffset(search); | 33 int offset = findOffset(search); |
37 for (OverriddenMember member in override.interfaceMembers) { | 34 for (OverriddenMember member in override.interfaceMembers) { |
38 if (member.element.location.offset == offset) { | 35 if (member.element.location.offset == offset) { |
(...skipping 533 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
572 class B extends A { | 569 class B extends A { |
573 set fff(x) {} // in B | 570 set fff(x) {} // in B |
574 } | 571 } |
575 '''); | 572 '''); |
576 await prepareOverrides(); | 573 await prepareOverrides(); |
577 assertHasOverride('fff(x) {} // in B'); | 574 assertHasOverride('fff(x) {} // in B'); |
578 assertHasSuperElement('fff(x) {} // in A'); | 575 assertHasSuperElement('fff(x) {} // in A'); |
579 assertNoInterfaceMembers(); | 576 assertNoInterfaceMembers(); |
580 } | 577 } |
581 } | 578 } |
OLD | NEW |