OLD | NEW |
1 // Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2011, 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 // TODO(rmacnak): Move the existing mirror tests here (a place for | 5 // TODO(rmacnak): Move the existing mirror tests here (a place for |
6 // cross-implementation tests). | 6 // cross-implementation tests). |
7 | 7 |
8 #library("MirrorsTest.dart"); | 8 #library("MirrorsTest.dart"); |
9 #import("dart:mirrors"); | 9 #import("dart:mirrors"); |
10 #import("../../../lib/unittest/unittest.dart"); | 10 #import("../../../pkg/unittest/unittest.dart"); |
11 | 11 |
12 var topLevelField; | 12 var topLevelField; |
13 | 13 |
14 class Class { | 14 class Class { |
15 Class() { this.field = "default value"; } | 15 Class() { this.field = "default value"; } |
16 Class.withInitialValue(this.field); | 16 Class.withInitialValue(this.field); |
17 var field; | 17 var field; |
18 static var staticField; | 18 static var staticField; |
19 } | 19 } |
20 | 20 |
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
83 } | 83 } |
84 | 84 |
85 main() { | 85 main() { |
86 var mirrors = currentMirrorSystem(); | 86 var mirrors = currentMirrorSystem(); |
87 | 87 |
88 test("Test field access", () { testFieldAccess(mirrors); }); | 88 test("Test field access", () { testFieldAccess(mirrors); }); |
89 test("Test closure mirrors", () { testClosureMirrors(mirrors); }); | 89 test("Test closure mirrors", () { testClosureMirrors(mirrors); }); |
90 test("Test invoke constructor", () { testInvokeConstructor(mirrors); }); | 90 test("Test invoke constructor", () { testInvokeConstructor(mirrors); }); |
91 } | 91 } |
92 | 92 |
OLD | NEW |