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

Unified Diff: tests/language/null_is_test.dart

Issue 22819005: Make Null a public class of dart:core. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: type cast, extends/implements prohibition Created 7 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: tests/language/null_is_test.dart
diff --git a/tests/language/null_is_test.dart b/tests/language/null_is_test.dart
index 395d47495ac1f4843ca3be1441c49b30d4666c50..9ac41d2aa682af258149b79f8e92696a3fae461c 100644
--- a/tests/language/null_is_test.dart
+++ b/tests/language/null_is_test.dart
@@ -6,10 +6,41 @@ import "package:expect/expect.dart";
main() {
Expect.isTrue(null is Object);
+ Expect.isTrue(null is Null);
Expect.isFalse(null is int);
Expect.isFalse(null is bool);
Expect.isFalse(null is num);
Expect.isFalse(null is String);
Expect.isFalse(null is List);
Expect.isFalse(null is Expect);
+
+ test(null);
+
+ Expect.isFalse(1 is Null);
+ Expect.isFalse("1" is Null);
+ Expect.isFalse(true is Null);
+ Expect.isFalse(false is Null);
+ Expect.isFalse(new Object() is Null);
+
+ testNegative(1);
+ testNegative("1");
+ testNegative(true);
+ testNegative(false);
+ testNegative(new Object());
+}
+
+test(n) {
+ // Test where the argument is not a compile-time constant.
+ Expect.isTrue(n is Object);
+ Expect.isTrue(n is Null);
+ Expect.isFalse(n is int);
+ Expect.isFalse(n is bool);
+ Expect.isFalse(n is num);
+ Expect.isFalse(n is String);
+ Expect.isFalse(n is List);
+ Expect.isFalse(n is Expect);
+}
+
+testNegative(n){
+ Expect.isFalse(n is Null);
}

Powered by Google App Engine
This is Rietveld 408576698