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

Unified Diff: tests/language_strong/list_literal3_test.dart

Issue 2771453003: Format all tests. (Closed)
Patch Set: Format files Created 3 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
Index: tests/language_strong/list_literal3_test.dart
diff --git a/tests/language_strong/list_literal3_test.dart b/tests/language_strong/list_literal3_test.dart
index d6151ce3aa72c90c8a8a3954fb1d82b3a9477081..f5dbd1d8173bc7a24d97926739c1e811dd461ab1 100644
--- a/tests/language_strong/list_literal3_test.dart
+++ b/tests/language_strong/list_literal3_test.dart
@@ -6,11 +6,9 @@
import "package:expect/expect.dart";
class ListLiteral3Test {
-
static const List<String> canonicalJoke = const ["knock", "knock"];
static testMain() {
-
List<String> joke = const ["knock", "knock"];
// Elements of canonical lists are canonicalized.
Expect.identical(joke, canonicalJoke);
@@ -18,12 +16,14 @@ class ListLiteral3Test {
Expect.identical(joke[0], canonicalJoke[0]);
// Lists from literals are immutable.
- Expect.throws(() { joke[0] = "sock"; }, (e) => e is UnsupportedError);
+ Expect.throws(() {
+ joke[0] = "sock";
+ }, (e) => e is UnsupportedError);
Expect.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.
+ List<String> lame_joke = ["knock", "knock"]; // Invokes operator new.
Expect.identical(joke[1], lame_joke[1]);
// Operator new creates a mutable list.
Expect.equals(false, identical(joke, lame_joke));
@@ -31,16 +31,26 @@ class ListLiteral3Test {
Expect.identical("who", lame_joke[1]);
// Elements of canonical lists are canonicalized.
- List<List<int>> a = const <List<int>>[ const [1, 2], const [1, 2]];
+ List<List<int>> a = const <List<int>>[
+ const [1, 2],
+ const [1, 2]
+ ];
Expect.identical(a[0], a[1]);
Expect.identical(a[0][0], a[1][0]);
- Expect.throws(() { a[0][0] = 42; }, (e) => e is UnsupportedError);
-
- List<List<double>> b = const [ const [1.0, 2.0], const [1.0, 2.0]];
+ Expect.throws(() {
+ a[0][0] = 42;
+ }, (e) => e is UnsupportedError);
+
+ List<List<double>> b = const [
+ const [1.0, 2.0],
+ const [1.0, 2.0]
+ ];
Expect.identical(b[0], b[1]);
Expect.equals(true, b[0][0] == 1.0);
Expect.identical(b[0][0], b[1][0]);
- Expect.throws(() { b[0][0] = 42.0; }, (e) => e is UnsupportedError);
+ Expect.throws(() {
+ b[0][0] = 42.0;
+ }, (e) => e is UnsupportedError);
}
}

Powered by Google App Engine
This is Rietveld 408576698