| 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 class ListTest { | 6 class ListTest { |
| 7 static void TestIterator() { | 7 static void TestIterator() { |
| 8 List<int> a = new List<int>(10); | 8 List<int> a = new List<int>(10); |
| 9 int count = 0; | 9 int count = 0; |
| 10 | 10 |
| (...skipping 119 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 130 } | 130 } |
| 131 Expect.equals(true, exceptionCaught); | 131 Expect.equals(true, exceptionCaught); |
| 132 | 132 |
| 133 exceptionCaught = false; | 133 exceptionCaught = false; |
| 134 try { | 134 try { |
| 135 var a = new List(99999999999999999999999); // Non-Smi. | 135 var a = new List(99999999999999999999999); // Non-Smi. |
| 136 } catch (Exception e) { // Must agree which exception to throw. | 136 } catch (Exception e) { // Must agree which exception to throw. |
| 137 exceptionCaught = true; | 137 exceptionCaught = true; |
| 138 } | 138 } |
| 139 Expect.equals(true, exceptionCaught); | 139 Expect.equals(true, exceptionCaught); |
| 140 |
| 141 exceptionCaught = false; |
| 142 List list = new List(); |
| 143 try { |
| 144 list.removeLast(); |
| 145 } catch (IndexOutOfRangeException e) { |
| 146 exceptionCaught = true; |
| 147 } |
| 148 Expect.equals(0, list.length); |
| 149 Expect.equals(true, exceptionCaught); |
| 140 } | 150 } |
| 141 } | 151 } |
| 142 | 152 |
| 143 main() { | 153 main() { |
| 144 ListTest.testMain(); | 154 ListTest.testMain(); |
| 145 } | 155 } |
| OLD | NEW |