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

Unified Diff: tests/corelib_strong/list_insert_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/corelib_strong/list_insert_test.dart
diff --git a/tests/corelib_strong/list_insert_test.dart b/tests/corelib_strong/list_insert_test.dart
index 50d088fc277a660ead3e40937fd96ec8f7bd5341..1efaafb19e97484f4e2e5fb433b237df404143f2 100644
--- a/tests/corelib_strong/list_insert_test.dart
+++ b/tests/corelib_strong/list_insert_test.dart
@@ -10,7 +10,9 @@ class MyList extends ListBase {
MyList(this.list);
get length => list.length;
- set length(val) { list.length = val; }
+ set length(val) {
+ list.length = val;
+ }
operator [](index) => list[index];
operator []=(index, val) => list[index] = val;
@@ -24,15 +26,21 @@ void testModifiableList(l1) {
assert(checkedMode = true);
// Index must be integer and in range.
- Expect.throws(() { l1.insert(-1, 5); },
- (e) => e is RangeError,
- "negative");
- Expect.throws(() { l1.insert(6, 5); },
- (e) => e is RangeError,
- "too large");
- Expect.throws(() { l1.insert(null, 5); });
- Expect.throws(() { l1.insert("1", 5); });
- Expect.throws(() { l1.insert(1.5, 5); });
+ Expect.throws(() {
+ l1.insert(-1, 5);
+ }, (e) => e is RangeError, "negative");
+ Expect.throws(() {
+ l1.insert(6, 5);
+ }, (e) => e is RangeError, "too large");
+ Expect.throws(() {
+ l1.insert(null, 5);
+ });
+ Expect.throws(() {
+ l1.insert("1", 5);
+ });
+ Expect.throws(() {
+ l1.insert(1.5, 5);
+ });
l1.insert(5, 5);
Expect.equals(6, l1.length);
@@ -53,15 +61,15 @@ void main() {
// Fixed size list.
var l2 = new List(5);
for (var i = 0; i < 5; i++) l2[i] = i;
- Expect.throws(() { l2.insert(2, 5); },
- (e) => e is UnsupportedError,
- "fixed-length");
+ Expect.throws(() {
+ l2.insert(2, 5);
+ }, (e) => e is UnsupportedError, "fixed-length");
// Unmodifiable list.
var l3 = const [0, 1, 2, 3, 4];
- Expect.throws(() { l3.insert(2, 5); },
- (e) => e is UnsupportedError,
- "unmodifiable");
+ Expect.throws(() {
+ l3.insert(2, 5);
+ }, (e) => e is UnsupportedError, "unmodifiable");
// Empty list is not special.
var l4 = [];

Powered by Google App Engine
This is Rietveld 408576698