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

Side by Side Diff: tests/corelib_strong/list_test.dart

Issue 2763823002: Move spaces from before comments to within comments (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 unified diff | Download patch
OLDNEW
1 // Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 import "dart:collection"; 5 import "dart:collection";
6 import "dart:typed_data"; 6 import "dart:typed_data";
7 import "package:expect/expect.dart"; 7 import "package:expect/expect.dart";
8 8
9 void main() { 9 void main() {
10 // Typed lists - fixed length and can only contain integers. 10 // Typed lists - fixed length and can only contain integers.
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after
57 try { 57 try {
58 list[list.length]; 58 list[list.length];
59 } catch (err, s) { 59 } catch (err, s) {
60 Expect.isTrue(err is RangeError, "$name[$index]"); 60 Expect.isTrue(err is RangeError, "$name[$index]");
61 Expect.equals(list.length, err.invalidValue, "$name[$index] value"); 61 Expect.equals(list.length, err.invalidValue, "$name[$index] value");
62 Expect.equals(list.length - 1, err.end, "$name[$index] end"); 62 Expect.equals(list.length - 1, err.end, "$name[$index] end");
63 Expect.equals(0, err.start, "$name[$index] start"); 63 Expect.equals(0, err.start, "$name[$index] start");
64 } 64 }
65 } 65 }
66 testIndex(list, name) { 66 testIndex(list, name) {
67 testIndexError(list, list.length, name); // Just too big. 67 testIndexError(list, list.length, name); // Just too big.
68 testIndexError(list, -1, name); // Negative. 68 testIndexError(list, -1, name); // Negative.
69 testIndexError(list, 0x123456789, name); // > 2^32. 69 testIndexError(list, 0x123456789, name); // > 2^32.
70 testIndexError(list, -0x123456789, name); // < -2^32. 70 testIndexError(list, -0x123456789, name); // < -2^32.
71 } 71 }
72 72
73 // Slices. 73 // Slices.
74 testSliceError(list, start, end, name) { 74 testSliceError(list, start, end, name) {
75 name = "$name[$start:$end]"; 75 name = "$name[$start:$end]";
76 var realError; 76 var realError;
77 try { 77 try {
78 RangeError.checkValidRange(start, end, list.length); 78 RangeError.checkValidRange(start, end, list.length);
79 } catch (e) { 79 } catch (e) {
(...skipping 502 matching lines...) Expand 10 before | Expand all | Expand 10 after
582 582
583 void testListConstructor() { 583 void testListConstructor() {
584 Expect.throws(() { new List(0).add(4); }); // Is fixed-length. 584 Expect.throws(() { new List(0).add(4); }); // Is fixed-length.
585 Expect.throws(() { new List(-2); }); // Not negative. /// 01: ok 585 Expect.throws(() { new List(-2); }); // Not negative. /// 01: ok
586 Expect.throws(() { new List(null); }); // Not null. 586 Expect.throws(() { new List(null); }); // Not null.
587 Expect.listEquals([4], new List()..add(4)); 587 Expect.listEquals([4], new List()..add(4));
588 Expect.throws(() { new List.filled(0, 42).add(4); }); // Is fixed-length. 588 Expect.throws(() { new List.filled(0, 42).add(4); }); // Is fixed-length.
589 Expect.throws(() { new List.filled(-2, 42); }); // Not negative. 589 Expect.throws(() { new List.filled(-2, 42); }); // Not negative.
590 Expect.throws(() { new List.filled(null, 42); }); // Not null. 590 Expect.throws(() { new List.filled(null, 42); }); // Not null.
591 } 591 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698