| OLD | NEW |
| 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 "package:expect/expect.dart"; |
| 6 |
| 5 main() { | 7 main() { |
| 6 var list = []; | 8 var list = []; |
| 7 list.removeRange(0, 0); | 9 list.removeRange(0, 0); |
| 8 Expect.equals(0, list.length); | 10 Expect.equals(0, list.length); |
| 9 expectIOORE(() { list.removeRange(0, 1); }); | 11 expectIOORE(() { list.removeRange(0, 1); }); |
| 10 | 12 |
| 11 list.add(1); | 13 list.add(1); |
| 12 list.removeRange(0, 0); | 14 list.removeRange(0, 0); |
| 13 Expect.equals(1, list.length); | 15 Expect.equals(1, list.length); |
| 14 Expect.equals(1, list[0]); | 16 Expect.equals(1, list[0]); |
| (...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 57 (e) => e is ArgumentError); | 59 (e) => e is ArgumentError); |
| 58 Expect.listEquals([1, 2], list); | 60 Expect.listEquals([1, 2], list); |
| 59 | 61 |
| 60 // A zero length prevails, and does not throw an exception. | 62 // A zero length prevails, and does not throw an exception. |
| 61 list.removeRange(-1, 0); | 63 list.removeRange(-1, 0); |
| 62 Expect.listEquals([1, 2], list); | 64 Expect.listEquals([1, 2], list); |
| 63 | 65 |
| 64 list.removeRange(4, 0); | 66 list.removeRange(4, 0); |
| 65 Expect.listEquals([1, 2], list); | 67 Expect.listEquals([1, 2], list); |
| 66 } | 68 } |
| OLD | NEW |