| 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 // Dart test program for testing arrays. | 4 // Dart test program for testing arrays. |
| 5 | 5 |
| 6 import "package:expect/expect.dart"; | 6 import "package:expect/expect.dart"; |
| 7 | 7 |
| 8 class A {} | 8 class A {} |
| 9 | 9 |
| 10 class B {} | 10 class B {} |
| (...skipping 103 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 114 Expect.equals(6, unsorted.length); | 114 Expect.equals(6, unsorted.length); |
| 115 Expect.equals(5, t.length); | 115 Expect.equals(5, t.length); |
| 116 TestIterator(); | 116 TestIterator(); |
| 117 int element = unsorted[2]; | 117 int element = unsorted[2]; |
| 118 Expect.equals(9, element); | 118 Expect.equals(9, element); |
| 119 | 119 |
| 120 Expect.throws( | 120 Expect.throws( |
| 121 () => unsorted[2.1], (e) => e is ArgumentError || e is TypeError); | 121 () => unsorted[2.1], (e) => e is ArgumentError || e is TypeError); |
| 122 | 122 |
| 123 Expect.throws(() => new List(-1)); | 123 Expect.throws(() => new List(-1)); |
| 124 Expect.throws(() => new List(99999999999999999999999)); | 124 Expect.throws(() => new List(0x7fffffffffffffff)); |
| 125 | 125 |
| 126 List list = new List(); | 126 List list = new List(); |
| 127 // We cannot write just 'list.removeLast' due to issue 3769. | 127 // We cannot write just 'list.removeLast' due to issue 3769. |
| 128 Expect.throws(() => list.removeLast(), (e) => e is RangeError); | 128 Expect.throws(() => list.removeLast(), (e) => e is RangeError); |
| 129 Expect.equals(0, list.length); | 129 Expect.equals(0, list.length); |
| 130 } | 130 } |
| 131 } | 131 } |
| 132 | 132 |
| 133 main() { | 133 main() { |
| 134 ListTest.testMain(); | 134 ListTest.testMain(); |
| 135 ListTest.testSublistTypeArguments(); | 135 ListTest.testSublistTypeArguments(); |
| 136 } | 136 } |
| OLD | NEW |