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

Unified Diff: pkg/kernel/testcases/reify/native_types_test.dart

Issue 2697873007: Merge the work on Generic Types Reification from 'dart-lang/reify' repo (Closed)
Patch Set: Get back parameter erroneously removed by previous commit Created 3 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
Index: pkg/kernel/testcases/reify/native_types_test.dart
diff --git a/pkg/kernel/testcases/reify/native_types_test.dart b/pkg/kernel/testcases/reify/native_types_test.dart
new file mode 100644
index 0000000000000000000000000000000000000000..a3514534ec7513f264fa177644d050793eaab5a7
--- /dev/null
+++ b/pkg/kernel/testcases/reify/native_types_test.dart
@@ -0,0 +1,47 @@
+// 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.
+
+library native_types;
+
+import 'test_base.dart';
+
+abstract class C {}
+
+class D {}
+
+var foo = bar;
+var bar = foo;
+
+main() {
+ expectTrue(1 is int);
+ expectTrue(1 is! double);
+
+ expectTrue(new List<int>() is List<int>);
+ expectTrue(new List<int>() is! List<double>);
+ expectTrue("hest" is String);
+ expectTrue("hest" is! int);
+
+ expectTrue(null is! String);
+ expectTrue(null is dynamic);
+ expectTrue(null is Object);
+
+ expectTrue(true is bool);
+ expectTrue(true is! int);
+
+ // Test error and exception classes
+ expectThrows(() => new C(), (e) => e is AbstractClassInstantiationError);
+
+ expectThrows(() => new D().foo(), (e) => e is NoSuchMethodError);
+
+ expectThrows(() => foo, (e) => e is CyclicInitializationError);
+
+ expectThrows(() => [][1], (e) => e is RangeError);
+
+ expectTrue(new UnsupportedError("") is UnsupportedError);
+
+ expectTrue(new ArgumentError() is ArgumentError);
+
+ expectTrue(
+ new IntegerDivisionByZeroException() is IntegerDivisionByZeroException);
+}

Powered by Google App Engine
This is Rietveld 408576698