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; | 5 library test.analysis.notification.overrides; |
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 208 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
219 m() {} // in C | 219 m() {} // in C |
220 } | 220 } |
221 '''); | 221 '''); |
222 return prepareOverrides().then((_) { | 222 return prepareOverrides().then((_) { |
223 assertHasOverride('m() {} // in C'); | 223 assertHasOverride('m() {} // in C'); |
224 assertNoSuperMember(); | 224 assertNoSuperMember(); |
225 assertHasInterfaceMember('m() {} // in A'); | 225 assertHasInterfaceMember('m() {} // in A'); |
226 }); | 226 }); |
227 } | 227 } |
228 | 228 |
| 229 test_staticMembers() { |
| 230 addTestFile(''' |
| 231 class A { |
| 232 static int F = 0; |
| 233 static void M() {} |
| 234 static int get G => 0; |
| 235 static void set S(int v) {} |
| 236 } |
| 237 class B extends A { |
| 238 static int F = 0; |
| 239 static void M() {} |
| 240 static int get G => 0; |
| 241 static void set S(int v) {} |
| 242 } |
| 243 '''); |
| 244 return prepareOverrides().then((_) { |
| 245 expect(overridesList, isEmpty); |
| 246 }); |
| 247 } |
| 248 |
229 test_super_fieldByField() { | 249 test_super_fieldByField() { |
230 addTestFile(''' | 250 addTestFile(''' |
231 class A { | 251 class A { |
232 int fff; // in A | 252 int fff; // in A |
233 } | 253 } |
234 class B extends A { | 254 class B extends A { |
235 int fff; // in B | 255 int fff; // in B |
236 } | 256 } |
237 '''); | 257 '''); |
238 return prepareOverrides().then((_) { | 258 return prepareOverrides().then((_) { |
(...skipping 141 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
380 set fff(x) {} // in B | 400 set fff(x) {} // in B |
381 } | 401 } |
382 '''); | 402 '''); |
383 return prepareOverrides().then((_) { | 403 return prepareOverrides().then((_) { |
384 assertHasOverride('fff(x) {} // in B'); | 404 assertHasOverride('fff(x) {} // in B'); |
385 assertHasSuperElement('fff(x) {} // in A'); | 405 assertHasSuperElement('fff(x) {} // in A'); |
386 assertNoInterfaceMembers(); | 406 assertNoInterfaceMembers(); |
387 }); | 407 }); |
388 } | 408 } |
389 } | 409 } |
OLD | NEW |