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

Unified Diff: tests/language/src/ListLiteral3Test.dart

Issue 10248007: test rename overhaul: step 8 - language tests (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 8 years, 8 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/language/src/ListLiteral2Test.dart ('k') | tests/language/src/ListLiteral4Test.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tests/language/src/ListLiteral3Test.dart
diff --git a/tests/language/src/ListLiteral3Test.dart b/tests/language/src/ListLiteral3Test.dart
deleted file mode 100644
index ebc58d242b4e8313779f0408e4292d6575fc7a20..0000000000000000000000000000000000000000
--- a/tests/language/src/ListLiteral3Test.dart
+++ /dev/null
@@ -1,65 +0,0 @@
-// Copyright (c) 2011, 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.
-// Check that arrays from final array literals are immutable.
-
-class ListLiteral3Test {
-
- static final List<String> canonicalJoke = const ["knock", "knock"];
-
- static testMain() {
-
- 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]);
-
- // Lists from literals are immutable.
- bool caughtException = false;
- try {
- joke[0] = "sock";
- } catch (UnsupportedOperationException e) {
- caughtException = true;
- }
- Expect.equals(true, caughtException);
- Expect.equals(true, 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]);
- // Operator new creates a mutable list.
- Expect.equals(false, joke === lame_joke);
- lame_joke[1] = "who";
- Expect.equals(true, "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]);
- try {
- caughtException = false;
- a[0][0] = 42;
- } catch (UnsupportedOperationException e) {
- caughtException = true;
- }
- 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]);
- try {
- caughtException = false;
- b[0][0] = 42.0;
- } catch (UnsupportedOperationException e) {
- caughtException = true;
- }
- Expect.equals(true, caughtException);
- }
-}
-
-main() {
- ListLiteral3Test.testMain();
-}
« no previous file with comments | « tests/language/src/ListLiteral2Test.dart ('k') | tests/language/src/ListLiteral4Test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698