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 287 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
298 expect(smoke.symbolToName(#i), 'i'); | 298 expect(smoke.symbolToName(#i), 'i'); |
299 }); | 299 }); |
300 | 300 |
301 test('name to symbol', () { | 301 test('name to symbol', () { |
302 expect(smoke.nameToSymbol('i'), #i); | 302 expect(smoke.nameToSymbol('i'), #i); |
303 }); | 303 }); |
304 }); | 304 }); |
305 | 305 |
306 test('invoke Type instance methods', () { | 306 test('invoke Type instance methods', () { |
307 var a = new A(); | 307 var a = new A(); |
308 expect(smoke.invoke(a.runtimeType, #toString, []), 'A'); | 308 expect( |
| 309 smoke.invoke(a.runtimeType, #toString, []), a.runtimeType.toString()); |
309 }); | 310 }); |
310 } | 311 } |
311 | 312 |
312 class A { | 313 class A { |
313 int i = 42; | 314 int i = 42; |
314 int j = 44; | 315 int j = 44; |
315 int get j2 => j; | 316 int get j2 => j; |
316 void set j2(int v) { j = v; } | 317 void set j2(int v) { j = v; } |
317 void inc0() { i++; } | 318 void inc0() { i++; } |
318 void inc1(int v) { i = i + (v == null ? -10 : v); } | 319 void inc1(int v) { i = i + (v == null ? -10 : v); } |
(...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
392 @a1 int f; | 393 @a1 int f; |
393 @a1 int g; | 394 @a1 int g; |
394 @a2 int h; | 395 @a2 int h; |
395 @a3 int i; | 396 @a3 int i; |
396 } | 397 } |
397 | 398 |
398 class K { | 399 class K { |
399 @AnnotC(named: true) int k; | 400 @AnnotC(named: true) int k; |
400 @AnnotC() int k2; | 401 @AnnotC() int k2; |
401 } | 402 } |
OLD | NEW |