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

Unified Diff: test/codegen/lib/mirrors/null2_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/no_metadata_test.dart ('k') | test/codegen/lib/mirrors/null_test.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/codegen/lib/mirrors/null2_test.dart
diff --git a/test/codegen/corelib/print_test.dart b/test/codegen/lib/mirrors/null2_test.dart
similarity index 58%
copy from test/codegen/corelib/print_test.dart
copy to test/codegen/lib/mirrors/null2_test.dart
index 7139d75e2f7c498b6317a3c6df52158a186dbdbd..4c5590d398f9ad7f7d251438ffbb1e3f2104c6cc 100644
--- a/test/codegen/corelib/print_test.dart
+++ b/test/codegen/lib/mirrors/null2_test.dart
@@ -2,20 +2,15 @@
// 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 'package:expect/expect.dart';
+library test.null_test;
-class A {
- toString() {
- if (false
- || true /// 01: runtime error
- ) {
- return 499;
- } else {
- return "ok";
- }
- }
-}
+import 'dart:mirrors';
+
+import 'package:expect/expect.dart';
main() {
- print(new A());
+ InstanceMirror nullMirror = reflect(null);
+ for (int i = 0; i < 10; i++) {
+ Expect.isTrue(nullMirror.getField(#hashCode).reflectee is int);
+ }
}
« no previous file with comments | « test/codegen/lib/mirrors/no_metadata_test.dart ('k') | test/codegen/lib/mirrors/null_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698