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

Unified Diff: tests/kernel/unsorted/as_is_test.dart

Issue 2453773002: Reland "Merge more Kernel infrastructure from kernel_sdk SDK fork." (Closed)
Patch Set: Created 4 years, 2 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/kernel/kernel.status ('k') | tests/kernel/unsorted/block_scope_test.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tests/kernel/unsorted/as_is_test.dart
diff --git a/tests/kernel/unsorted/as_is_test.dart b/tests/kernel/unsorted/as_is_test.dart
new file mode 100644
index 0000000000000000000000000000000000000000..a9ec01585a49701b493ac8f6ba6506e82eacb927
--- /dev/null
+++ b/tests/kernel/unsorted/as_is_test.dart
@@ -0,0 +1,28 @@
+// Copyright (c) 2016, 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.
+
+// Tests of class literals, is, and as expressions.
+
+import 'expect.dart';
+
+class C {}
+
+class D extends C {}
+
+test0() => C;
+test1() => D;
+
+main() {
+ var c = new C();
+ var d = new D();
+ Expect.isTrue(test0() == C);
+ Expect.isTrue(test1() == D);
+ Expect.isTrue(c is C);
+ Expect.isTrue(c is! D);
+ Expect.isTrue(d is C);
+ Expect.isTrue(d is D);
+ Expect.isTrue(c as C == c);
+ Expect.isTrue(d as C == d);
+ Expect.isTrue(d as D == d);
+}
« no previous file with comments | « tests/kernel/kernel.status ('k') | tests/kernel/unsorted/block_scope_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698