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

Unified Diff: test/codegen/lib/mirrors/static_const_field_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
Index: test/codegen/lib/mirrors/static_const_field_test.dart
diff --git a/test/codegen/language/cascade_in_initializer_list_test.dart b/test/codegen/lib/mirrors/static_const_field_test.dart
similarity index 52%
copy from test/codegen/language/cascade_in_initializer_list_test.dart
copy to test/codegen/lib/mirrors/static_const_field_test.dart
index 8e7e9ee11e9fa950fa4db917c36c135d5bec357f..f6fd959de34473e068f0c6434d1ab41e24014ab2 100644
--- a/test/codegen/language/cascade_in_initializer_list_test.dart
+++ b/test/codegen/lib/mirrors/static_const_field_test.dart
@@ -2,22 +2,17 @@
// 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.
+// Test that static const fields are accessible by reflection.
+// Regression test for http://dartbug.com/23811.
+
+@MirrorsUsed(targets: const [A])
+import "dart:mirrors";
import "package:expect/expect.dart";
class A {
- foo() {}
- bar() {}
-}
-
-class B {
- var x;
- final y;
-
- B(a) : x = a..foo()..bar(), y = a..foo()..bar() {}
+ static const ONE = 1;
}
main() {
- var a = new A(), b = new B(a);
- Expect.equals(a, b.x);
- Expect.equals(a, b.y);
-}
+ Expect.equals(1, reflectClass(A).getField(#ONE).reflectee);
+}

Powered by Google App Engine
This is Rietveld 408576698