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

Unified Diff: tests/lib/mirrors/reflected_type_classes_test.dart

Issue 183853022: Hoist hasReflectedType and reflectedType from ClassMirror to TypeMirror. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 years, 10 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 | « tests/lib/lib.status ('k') | tests/lib/mirrors/reflected_type_function_type_test.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tests/lib/mirrors/reflected_type_classes_test.dart
diff --git a/tests/lib/mirrors/reflected_type_test.dart b/tests/lib/mirrors/reflected_type_classes_test.dart
similarity index 70%
copy from tests/lib/mirrors/reflected_type_test.dart
copy to tests/lib/mirrors/reflected_type_classes_test.dart
index a574434f1b2c273f2939fb5814e3139a0c5b0a77..4eeb3d8f29c412487853c9f2ddc45a9e0f5934d7 100644
--- a/tests/lib/mirrors/reflected_type_test.dart
+++ b/tests/lib/mirrors/reflected_type_classes_test.dart
@@ -1,12 +1,12 @@
-// Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file
+// Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file
// 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.
-library test.reflected_type_test;
+library test.reflected_type_classes;
import 'dart:mirrors';
-import 'package:expect/expect.dart';
+import 'reflected_type_helper.dart';
class A<T> {}
class B extends A {}
@@ -17,29 +17,7 @@ class F<R> extends A<int> {}
class G {}
class H<A,B,C> {}
-expectReflectedType(classMirror, expectedType) {
- if (expectedType == null) {
- Expect.isFalse(classMirror.hasReflectedType,
- "$classMirror should not have a reflected type");
- Expect.throws(() => classMirror.reflectedType,
- (e) => e is UnsupportedError);
- } else {
- Expect.isTrue(classMirror.hasReflectedType,
- "$classMirror should have a reflected type");
- Expect.equals(expectedType, classMirror.reflectedType);
- }
-}
-
main() {
- // Basic non-generic types, including intercepted types.
- expectReflectedType(reflectClass(Object), Object);
- expectReflectedType(reflectClass(String), String);
- expectReflectedType(reflectClass(int), int);
- expectReflectedType(reflectClass(num), num);
- expectReflectedType(reflectClass(double), double);
- expectReflectedType(reflectClass(bool), bool);
- expectReflectedType(reflectClass(Null), Null);
-
// Declarations.
expectReflectedType(reflectClass(A), null);
expectReflectedType(reflectClass(B), B);
« no previous file with comments | « tests/lib/lib.status ('k') | tests/lib/mirrors/reflected_type_function_type_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698