| OLD | NEW |
| 1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2013, 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.constructors_test; | 5 library test.constructors_test; |
| 6 | 6 |
| 7 import 'dart:mirrors'; | 7 import 'dart:mirrors'; |
| 8 | 8 |
| 9 import 'package:expect/expect.dart'; | 9 import 'package:expect/expect.dart'; |
| 10 | 10 |
| 11 import 'reflect_model_test.dart'; | 11 import 'stringify.dart'; |
| 12 | 12 |
| 13 class Foo { | 13 class Foo { |
| 14 } | 14 } |
| 15 | 15 |
| 16 class Bar { | 16 class Bar { |
| 17 Bar(); | 17 Bar(); |
| 18 } | 18 } |
| 19 | 19 |
| 20 class Baz { | 20 class Baz { |
| 21 Baz.named(); | 21 Baz.named(); |
| (...skipping 16 matching lines...) Expand all Loading... |
| 38 Map<Symbol, MethodMirror> bizConstructors = bizMirror.constructors; | 38 Map<Symbol, MethodMirror> bizConstructors = bizMirror.constructors; |
| 39 | 39 |
| 40 expect('{Foo: Method(s(Foo) in s(Foo), constructor)}', fooConstructors); | 40 expect('{Foo: Method(s(Foo) in s(Foo), constructor)}', fooConstructors); |
| 41 expect('{Bar: Method(s(Bar) in s(Bar), constructor)}', barConstructors); | 41 expect('{Bar: Method(s(Bar) in s(Bar), constructor)}', barConstructors); |
| 42 expect('{Baz.named: Method(s(Baz.named) in s(Baz), constructor)}', | 42 expect('{Baz.named: Method(s(Baz.named) in s(Baz), constructor)}', |
| 43 bazConstructors); | 43 bazConstructors); |
| 44 expect('{Biz: Method(s(Biz) in s(Biz), constructor),' | 44 expect('{Biz: Method(s(Biz) in s(Biz), constructor),' |
| 45 ' Biz.named: Method(s(Biz.named) in s(Biz), constructor)}', | 45 ' Biz.named: Method(s(Biz.named) in s(Biz), constructor)}', |
| 46 bizConstructors); | 46 bizConstructors); |
| 47 print(bizConstructors); | 47 print(bizConstructors); |
| 48 |
| 49 expect('[]', fooConstructors.values.single.parameters); |
| 50 expect('[]', barConstructors.values.single.parameters); |
| 51 expect('[]', bazConstructors.values.single.parameters); |
| 52 for (var constructor in bizConstructors.values) { |
| 53 expect('[]', constructor.parameters); |
| 54 } |
| 48 } | 55 } |
| OLD | NEW |