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

Unified Diff: tests/language/list_literal3_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/list_literal3_test.dart
diff --git a/tests/language/list_literal3_test.dart b/tests/language/list_literal3_test.dart
index 497aee43d6cc0f68846a281428ae1f086479b76b..4c6c6ca85bfa28d6c449b19edbd6e5caaa7b7ca0 100644
--- a/tests/language/list_literal3_test.dart
+++ b/tests/language/list_literal3_test.dart
@@ -11,9 +11,9 @@ class ListLiteral3Test {
List<String> joke = const ["knock", "knock"];
// Elements of canonical lists are canonicalized.
- Expect.equals(true, joke === canonicalJoke);
- Expect.equals(true, joke[0] === joke[1]);
- Expect.equals(true, joke[0] === canonicalJoke[0]);
+ Expect.equals(true, identical(joke, canonicalJoke));
+ Expect.equals(true, identical(joke[0], joke[1]));
+ Expect.equals(true, identical(joke[0], canonicalJoke[0]));
// Lists from literals are immutable.
bool caughtException = false;
@@ -23,21 +23,21 @@ class ListLiteral3Test {
caughtException = true;
}
Expect.equals(true, caughtException);
- Expect.equals(true, joke[0] === joke[1]);
+ Expect.equals(true, identical(joke[0], joke[1]));
// Make sure lists allocated at runtime are mutable and are
// not canonicalized.
List<String> lame_joke = ["knock", "knock"]; // Invokes operator new.
- Expect.equals(true, joke[1] === lame_joke[1]);
+ Expect.equals(true, identical(joke[1], lame_joke[1]));
// Operator new creates a mutable list.
- Expect.equals(false, joke === lame_joke);
+ Expect.equals(false, identical(joke, lame_joke));
lame_joke[1] = "who";
- Expect.equals(true, "who" === lame_joke[1]);
+ Expect.equals(true, identical("who", lame_joke[1]));
// Elements of canonical lists are canonicalized.
List<List<int>> a = const <List<int>>[ const [1, 2], const [1, 2]];
- Expect.equals(true, a[0] === a[1]);
- Expect.equals(true, a[0][0] === a[1][0]);
+ Expect.equals(true, identical(a[0], a[1]));
Lasse Reichstein Nielsen 2012/11/12 13:10:41 Expect.identical
floitsch 2012/11/12 22:18:43 Done.
+ Expect.equals(true, identical(a[0][0], a[1][0]));
try {
caughtException = false;
a[0][0] = 42;
@@ -47,9 +47,9 @@ class ListLiteral3Test {
Expect.equals(true, caughtException);
List<List<double>> b = const [ const [1.0, 2.0], const [1.0, 2.0]];
- Expect.equals(true, b[0] === b[1]);
- Expect.equals(true, b[0][0] === 1.0);
- Expect.equals(true, b[0][0] === b[1][0]);
+ Expect.equals(true, identical(b[0], b[1]));
+ Expect.equals(true, b[0][0] == 1.0);
+ Expect.equals(true, identical(b[0][0], b[1][0]));
try {
caughtException = false;
b[0][0] = 42.0;

Powered by Google App Engine
This is Rietveld 408576698