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

Unified Diff: tests/language/canonical_const_test.dart

Issue 11361190: a === b -> identical(a, b) (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: 80chars. Created 8 years, 1 month 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/canonical_const_test.dart
diff --git a/tests/language/canonical_const_test.dart b/tests/language/canonical_const_test.dart
index c10ce62b81cf025621faf71b4b3040d630ec0c69..65ade55ae710c8df3514e9d916b27185fc476407 100644
--- a/tests/language/canonical_const_test.dart
+++ b/tests/language/canonical_const_test.dart
@@ -8,26 +8,26 @@ class CanonicalConstTest {
static const B = const C2();
static testMain() {
- Expect.isTrue(null===null);
- Expect.isTrue(null!==0);
- Expect.isTrue(1===1);
- Expect.isTrue(1!==2);
- Expect.isTrue(true===true);
- Expect.isTrue("so"==="so");
- Expect.isTrue(const Object()===const Object());
- Expect.isTrue(const Object()!==const C1());
- Expect.isTrue(const C1()===const C1());
- Expect.isTrue(A===const C1());
- Expect.isTrue(const C1()!==const C2());
- Expect.isTrue(B===const C2());
+ Expect.isTrue(identical(null, null));
Lasse Reichstein Nielsen 2012/11/12 13:10:41 Use Expect.identical and Expect.isFalse(identic
floitsch 2012/11/12 22:18:43 Done.
+ Expect.isTrue(!identical(null, 0));
+ Expect.isTrue(identical(1, 1));
+ Expect.isTrue(!identical(1, 2));
+ Expect.isTrue(identical(true, true));
+ Expect.isTrue(identical("so", "so"));
+ Expect.isTrue(identical(const Object(), const Object()));
+ Expect.isTrue(!identical(const Object(), const C1()));
+ Expect.isTrue(identical(const C1(), const C1()));
+ Expect.isTrue(identical(A, const C1()));
+ Expect.isTrue(!identical(const C1(), const C2()));
+ Expect.isTrue(identical(B, const C2()));
// TODO(johnlenz): these two values don't currently have the same type
// Expect.isTrue(const [1,2] === const List[1,2]);
- Expect.isTrue(const [2,1] !== const[1,2]);
- Expect.isTrue(const <int>[1,2] === const <int>[1,2]);
- Expect.isTrue(const <Object>[1,2] === const <Object>[1,2]);
- Expect.isTrue(const <int>[1,2] !== const <double>[1.0,2.0]);
- Expect.isTrue(const {"a":1, "b":2} === const {"a":1, "b":2});
- Expect.isTrue(const {"a":1, "b":2} !== const {"a":2, "b":2});
+ Expect.isTrue(!identical(const [2,1], const[1,2]));
+ Expect.isTrue(identical(const <int>[1,2], const <int>[1,2]));
+ Expect.isTrue(identical(const <Object>[1,2], const <Object>[1,2]));
+ Expect.isTrue(!identical(const <int>[1,2], const <double>[1.0,2.0]));
+ Expect.isTrue(identical(const {"a":1, "b":2}, const {"a":1, "b":2}));
+ Expect.isTrue(!identical(const {"a":1, "b":2}, const {"a":2, "b":2}));
}
}

Powered by Google App Engine
This is Rietveld 408576698