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 /// Common test code that is run by 3 tests: mirrors_test.dart, | 5 /// Common test code that is run by 3 tests: mirrors_test.dart, |
6 /// mirrors_used_test.dart, and static_test.dart. | 6 /// mirrors_used_test.dart, and static_test.dart. |
7 library smoke.test.common; | 7 library smoke.test.common; |
8 | 8 |
9 import 'package:smoke/smoke.dart' as smoke; | 9 import 'package:smoke/smoke.dart' as smoke; |
10 import 'package:unittest/unittest.dart'; | 10 import 'package:unittest/unittest.dart'; |
(...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
115 // TODO(sigmund): should we support declaring a setter with no getter? | 115 // TODO(sigmund): should we support declaring a setter with no getter? |
116 // expect(smoke.hasSetter(E, #x), isTrue); | 116 // expect(smoke.hasSetter(E, #x), isTrue); |
117 expect(smoke.hasSetter(E, #y), isFalse); | 117 expect(smoke.hasSetter(E, #y), isFalse); |
118 expect(smoke.hasSetter(E, #z), isFalse); // don't consider noSuchMethod | 118 expect(smoke.hasSetter(E, #z), isFalse); // don't consider noSuchMethod |
119 }); | 119 }); |
120 | 120 |
121 test('no such method', () { | 121 test('no such method', () { |
122 expect(smoke.hasNoSuchMethod(A), isFalse); | 122 expect(smoke.hasNoSuchMethod(A), isFalse); |
123 expect(smoke.hasNoSuchMethod(E), isTrue); | 123 expect(smoke.hasNoSuchMethod(E), isTrue); |
124 expect(smoke.hasNoSuchMethod(E2), isTrue); | 124 expect(smoke.hasNoSuchMethod(E2), isTrue); |
| 125 expect(smoke.hasNoSuchMethod(int), isFalse); |
125 }); | 126 }); |
126 | 127 |
127 test('has instance method', () { | 128 test('has instance method', () { |
128 expect(smoke.hasInstanceMethod(A, #inc0), isTrue); | 129 expect(smoke.hasInstanceMethod(A, #inc0), isTrue); |
129 expect(smoke.hasInstanceMethod(A, #inc3), isFalse); | 130 expect(smoke.hasInstanceMethod(A, #inc3), isFalse); |
130 expect(smoke.hasInstanceMethod(C, #inc), isTrue); | 131 expect(smoke.hasInstanceMethod(C, #inc), isTrue); |
131 expect(smoke.hasInstanceMethod(D, #inc), isTrue); | 132 expect(smoke.hasInstanceMethod(D, #inc), isTrue); |
132 expect(smoke.hasInstanceMethod(D, #inc0), isTrue); | 133 expect(smoke.hasInstanceMethod(D, #inc0), isTrue); |
133 expect(smoke.hasInstanceMethod(F, #staticMethod), isFalse); | 134 expect(smoke.hasInstanceMethod(F, #staticMethod), isFalse); |
134 expect(smoke.hasInstanceMethod(F2, #staticMethod), isFalse); | 135 expect(smoke.hasInstanceMethod(F2, #staticMethod), isFalse); |
(...skipping 246 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
381 @a2 int d; | 382 @a2 int d; |
382 } | 383 } |
383 | 384 |
384 class H extends G { | 385 class H extends G { |
385 int e; | 386 int e; |
386 @a1 int f; | 387 @a1 int f; |
387 @a1 int g; | 388 @a1 int g; |
388 @a2 int h; | 389 @a2 int h; |
389 @a3 int i; | 390 @a3 int i; |
390 } | 391 } |
OLD | NEW |