OLD | NEW |
1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2012, 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 // Dart test program for checking implemention of MirrorSystem when | 5 // Dart test program for checking implemention of MirrorSystem when |
6 // inspecting the current isolate. | 6 // inspecting the current isolate. |
7 // | 7 // |
8 // VMOptions=--enable_type_checks | 8 // VMOptions=--enable_type_checks |
9 | 9 |
10 library isolate_mirror_local_test; | 10 library isolate_mirror_local_test; |
(...skipping 234 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
245 Expect.isTrue(func is MethodMirror); | 245 Expect.isTrue(func is MethodMirror); |
246 Expect.equals('myVar= return(void) toplevel static setter', | 246 Expect.equals('myVar= return(void) toplevel static setter', |
247 buildMethodString(func)); | 247 buildMethodString(func)); |
248 | 248 |
249 func = cls_mirror.members[const Symbol('method')]; | 249 func = cls_mirror.members[const Symbol('method')]; |
250 Expect.isTrue(func is MethodMirror); | 250 Expect.isTrue(func is MethodMirror); |
251 Expect.equals('method return(int) method', buildMethodString(func)); | 251 Expect.equals('method return(int) method', buildMethodString(func)); |
252 | 252 |
253 func = cls_mirror.constructors[const Symbol('MyClass')]; | 253 func = cls_mirror.constructors[const Symbol('MyClass')]; |
254 Expect.isTrue(func is MethodMirror); | 254 Expect.isTrue(func is MethodMirror); |
255 Expect.equals('MyClass return(MyClass) constructor', buildMethodString(func)); | 255 Expect.equals('MyClass return(MyClass) constructor generative', |
| 256 buildMethodString(func)); |
256 | 257 |
257 func = cls_mirror.constructors[const Symbol('MyClass.named')]; | 258 func = cls_mirror.constructors[const Symbol('MyClass.named')]; |
258 Expect.isTrue(func is MethodMirror); | 259 Expect.isTrue(func is MethodMirror); |
259 Expect.equals('MyClass.named return(MyClass) constructor', | 260 Expect.equals('MyClass.named return(MyClass) constructor generative', |
260 buildMethodString(func)); | 261 buildMethodString(func)); |
261 | 262 |
262 func = generic_cls_mirror.members[const Symbol('method')]; | 263 func = generic_cls_mirror.members[const Symbol('method')]; |
263 Expect.isTrue(func is MethodMirror); | 264 Expect.isTrue(func is MethodMirror); |
264 Expect.equals('method return(T) method', buildMethodString(func)); | 265 Expect.equals('method return(T) method', buildMethodString(func)); |
265 | 266 |
266 // Test variable mirrors. | 267 // Test variable mirrors. |
267 VariableMirror variable = lib_mirror.members[const Symbol('global_var')]; | 268 VariableMirror variable = lib_mirror.members[const Symbol('global_var')]; |
268 Expect.isTrue(variable is VariableMirror); | 269 Expect.isTrue(variable is VariableMirror); |
269 Expect.equals('global_var type(int) toplevel static', | 270 Expect.equals('global_var type(int) toplevel static', |
(...skipping 264 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
534 // Test that an isolate can reflect on itself. | 535 // Test that an isolate can reflect on itself. |
535 mirrorSystemOf(exit_port.toSendPort()).then(testMirrorSystem); | 536 mirrorSystemOf(exit_port.toSendPort()).then(testMirrorSystem); |
536 | 537 |
537 testIntegerInstanceMirror(reflect(1001)); | 538 testIntegerInstanceMirror(reflect(1001)); |
538 testStringInstanceMirror(reflect('This\nis\na\nString')); | 539 testStringInstanceMirror(reflect('This\nis\na\nString')); |
539 testBoolInstanceMirror(reflect(true)); | 540 testBoolInstanceMirror(reflect(true)); |
540 testNullInstanceMirror(reflect(null)); | 541 testNullInstanceMirror(reflect(null)); |
541 testCustomInstanceMirror(reflect(new MyClass(17))); | 542 testCustomInstanceMirror(reflect(new MyClass(17))); |
542 testMirrorErrors(currentMirrorSystem()); | 543 testMirrorErrors(currentMirrorSystem()); |
543 } | 544 } |
OLD | NEW |