| Index: tests/lib/mirrors/constructors_test.dart
|
| ===================================================================
|
| --- tests/lib/mirrors/constructors_test.dart (revision 24825)
|
| +++ tests/lib/mirrors/constructors_test.dart (working copy)
|
| @@ -26,6 +26,14 @@
|
| Biz.named();
|
| }
|
|
|
| +class Buz {
|
| + var x;
|
| + Buz.generative(this.x);
|
| + Buz.redirecting(y) : this.generative(y*2);
|
| + factory Buz.faktory(y) => "Buz $y";
|
| + factory Buz.redirectingFactory(y) = Buz.faktory;
|
| +}
|
| +
|
| main() {
|
| MirrorSystem mirrors = currentMirrorSystem();
|
| ClassMirror fooMirror = reflectClass(Foo);
|
| @@ -62,4 +70,18 @@
|
| expect('[s(), s(named)]',
|
| bizConstructors.values.map((m) => m.constructorName).toList()
|
| ..sort(compareSymbols));
|
| +
|
| + ClassMirror buzMirror = reflectClass(Buz);
|
| + Expect.equals(7,
|
| + buzMirror.newInstance(const Symbol('generative'),
|
| + [7]).reflectee.x);
|
| + Expect.equals(14,
|
| + buzMirror.newInstance(const Symbol('redirecting'),
|
| + [7]).reflectee.x);
|
| + Expect.equals('Buz 7',
|
| + buzMirror.newInstance(const Symbol('faktory'),
|
| + [7]).reflectee);
|
| + Expect.equals('Buz 7',
|
| + buzMirror.newInstance(const Symbol('redirectingFactory'),
|
| + [7]).reflectee);
|
| }
|
|
|