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

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

Issue 70073004: Revert "Retain types of toplevel and instance variables for reflection." (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years, 1 month 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/generic_type_mirror_test.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tests/lib/mirrors/field_type_test.dart
diff --git a/tests/lib/mirrors/field_type_test.dart b/tests/lib/mirrors/field_type_test.dart
deleted file mode 100644
index 0191f3f6ea310d31b489845f56db224dfc4bcfca..0000000000000000000000000000000000000000
--- a/tests/lib/mirrors/field_type_test.dart
+++ /dev/null
@@ -1,76 +0,0 @@
-// Copyright (c) 2013, 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 field_test;
-
-import 'dart:mirrors';
-import "package:expect/expect.dart";
-
-String toplevelVariable;
-class C {
- final int i;
- const C(this.i);
-}
-class A<T> {
- static int staticField;
- @C(42)
- @C(44)
- String field;
- var dynamicTypeField;
- T typeVariableField;
- H<int> parameterizedTypeField;
-}
-
-class H<T> {}
-
-testOriginalDeclaration() {
- ClassMirror a = reflectClass(A);
- VariableMirror staticField = a.variables[#staticField];
- VariableMirror field = a.variables[#field];
- VariableMirror dynamicTypeField = a.variables[#dynamicTypeField];
- VariableMirror typeVariableField = a.variables[#typeVariableField];
- VariableMirror parameterizedTypeField = a.variables[#parameterizedTypeField];
-
- Expect.equals(reflectType(int), staticField.type);
- Expect.equals(reflectClass(String), field.type);
- Expect.equals(reflectType(dynamic), dynamicTypeField.type);
- Expect.equals(a.typeVariables.single, typeVariableField.type);
- Expect.equals(reflect(new H<int>()).type, parameterizedTypeField.type);
-
- Expect.equals(2, field.metadata.length);
- Expect.equals(reflect(const C(42)), field.metadata.first);
- Expect.equals(reflect(const C(44)), field.metadata.last);
-}
-
-testInstance() {
- ClassMirror aOfString = reflect(new A<String>()).type;
- VariableMirror staticField = aOfString.variables[#staticField];
- VariableMirror field = aOfString.variables[#field];
- VariableMirror dynamicTypeField = aOfString.variables[#dynamicTypeField];
- VariableMirror typeVariableField = aOfString.variables[#typeVariableField];
- VariableMirror parameterizedTypeField =
- aOfString.variables[#parameterizedTypeField];
-
- Expect.equals(reflectType(int), staticField.type);
- Expect.equals(reflectClass(String), field.type);
- Expect.equals(reflectType(dynamic), dynamicTypeField.type);
- Expect.equals(reflectClass(String), typeVariableField.type);
- Expect.equals(reflect(new H<int>()).type, parameterizedTypeField.type);
-
- Expect.equals(2, field.metadata.length);
- Expect.equals(reflect(const C(42)), field.metadata.first);
- Expect.equals(reflect(const C(44)), field.metadata.last);
-}
-
-testTopLevel() {
- LibraryMirror currentLibrary = currentMirrorSystem().findLibrary(#field_test);
- VariableMirror topLevel = currentLibrary.variables.values.first;
- Expect.equals(reflectClass(String), topLevel.type);
-}
-
-main() {
- testOriginalDeclaration();
- testInstance();
- testTopLevel();
-}
« no previous file with comments | « tests/lib/lib.status ('k') | tests/lib/mirrors/generic_type_mirror_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698