Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1231)

Unified Diff: test/codegen/lib/mirrors/typedef_library_test.dart

Issue 2265533002: Add mirrors tests (Closed) Base URL: https://github.com/dart-lang/dev_compiler.git@master
Patch Set: Created 4 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « test/codegen/lib/mirrors/typedef_library.dart ('k') | test/codegen/lib/mirrors/typedef_metadata_test.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/codegen/lib/mirrors/typedef_library_test.dart
diff --git a/test/codegen/language/redirecting_factory_reflection_test.dart b/test/codegen/lib/mirrors/typedef_library_test.dart
similarity index 50%
copy from test/codegen/language/redirecting_factory_reflection_test.dart
copy to test/codegen/lib/mirrors/typedef_library_test.dart
index af39373979bc72406783fa62c47056de3f644f42..6549797a49a0fe338b8a0acb0c5d643ef49a896e 100644
--- a/test/codegen/language/redirecting_factory_reflection_test.dart
+++ b/test/codegen/lib/mirrors/typedef_library_test.dart
@@ -2,21 +2,16 @@
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
-import 'dart:mirrors';
-import 'package:expect/expect.dart';
+library foo;
-abstract class A<T> {
- get t;
- factory A() = B<T, A<T>>;
-}
+@MirrorsUsed(targets: const ["foo", "bar"])
+import 'dart:mirrors';
+import 'typedef_library.dart';
-class B<X, Y> implements A<X> {
- final t;
- B() : t = Y;
-}
+import 'package:expect/expect.dart';
main() {
- ClassMirror m = reflectClass(A);
- var i = m.newInstance(const Symbol(''), []).reflectee;
- Expect.equals(i.t.toString(), 'A');
+ var barLibrary = currentMirrorSystem().findLibrary(new Symbol("bar"));
+ var gTypedef = barLibrary.declarations[new Symbol("G")];
+ Expect.equals("G", MirrorSystem.getName(gTypedef.simpleName));
}
« no previous file with comments | « test/codegen/lib/mirrors/typedef_library.dart ('k') | test/codegen/lib/mirrors/typedef_metadata_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698