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

Unified Diff: tests/language_strong/map_literal3_test.dart

Issue 2770063002: Revert "Format all multitests" (Closed)
Patch Set: Created 3 years, 9 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_strong/map_literal1_test.dart ('k') | tests/language_strong/metadata_scope1_test.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tests/language_strong/map_literal3_test.dart
diff --git a/tests/language_strong/map_literal3_test.dart b/tests/language_strong/map_literal3_test.dart
index 1aa9bed9951f1e995f1817da2bbb196efa1a517a..f2f02a258600015cbbdad03e9c9c76343b4615d6 100644
--- a/tests/language_strong/map_literal3_test.dart
+++ b/tests/language_strong/map_literal3_test.dart
@@ -6,8 +6,9 @@
import "package:expect/expect.dart";
class MapLiteralTest {
+
static testMain() {
- var map = {"a": 1, "b": 2, "c": 3};
+ var map = { "a": 1, "b": 2, "c": 3 };
Expect.equals(map.length, 3);
Expect.equals(map["a"], 1);
@@ -33,12 +34,7 @@ class MapLiteralTest {
Expect.equals(map.length, 0);
var b = 22;
- Expect.equals(
- 22,
- {
- "a": 11,
- "b": b,
- }["b"]);
+ Expect.equals(22, {"a": 11, "b": b, }["b"]);
// Make map grow. We currently don't have a way to construct
// strings from an integer value, so we can't use a loop here.
@@ -62,7 +58,7 @@ class MapLiteralTest {
m["16"] = 16;
Expect.equals(16, m.length);
m.remove("1");
- m.remove("1"); // Remove element twice.
+ m.remove("1"); // Remove element twice.
m.remove("16");
Expect.equals(14, m.length);
@@ -86,33 +82,25 @@ class MapLiteralTest {
// Check that even if a key gets eliminated (the first "a"), all values
// are still evaluated, including side effects.
int counter = 0;
- int ctr() {
- counter += 10;
- return counter;
- }
-
+ int ctr() { counter += 10; return counter; }
mmap = <String, num>{"a": ctr(), "b": ctr(), "a": ctr()}; //# static type warning
Expect.equals(2, mmap.length);
Expect.equals(40, ctr());
Expect.equals(30, mmap["a"]);
Expect.equals(20, mmap["b"]);
- Expect.equals(10, {"beta": 100, "alpha": 9 + 1}["alpha"]);
- Expect.equals(
- 10,
- <String, Map>{
- "beta": {"delta": 10},
- "alpha": {"gamma": 10}
- }["alpha"]["gamma"]);
+ Expect.equals(10, { "beta": 100, "alpha": 9 + 1 }["alpha"]);
+ Expect.equals(10, <String, Map>{
+ "beta": {"delta": 10},
+ "alpha": {"gamma": 10} }["alpha"]["gamma"]);
// Map literals at beginning of statement.
- <
- String,
- num>{"pink": 100};
+ <String, num>{"pink": 100};
const <String, num>{"floyd": 100};
}
}
+
main() {
MapLiteralTest.testMain();
}
« no previous file with comments | « tests/language_strong/map_literal1_test.dart ('k') | tests/language_strong/metadata_scope1_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698