| 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 class ListTest { | 5 class ListTest { |
| 6 | 6 |
| 7 static testMain() { | 7 static testMain() { |
| 8 testList(); | 8 testList(); |
| 9 testExpandableList(); | 9 testExpandableList(); |
| 10 } | 10 } |
| (...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 83 Expect.equals(3, list.lastIndexOf(100)); | 83 Expect.equals(3, list.lastIndexOf(100)); |
| 84 list[3] = 3; | 84 list[3] = 3; |
| 85 Expect.equals(-1, list.indexOf(100)); | 85 Expect.equals(-1, list.indexOf(100)); |
| 86 Expect.equals(-1, list.lastIndexOf(100)); | 86 Expect.equals(-1, list.lastIndexOf(100)); |
| 87 | 87 |
| 88 testClosures(list); | 88 testClosures(list); |
| 89 | 89 |
| 90 var exception = null; | 90 var exception = null; |
| 91 try { | 91 try { |
| 92 list.clear(); | 92 list.clear(); |
| 93 } on UnsupportedOperationException catch (e) { | 93 } on StateError catch (e) { |
| 94 exception = e; | 94 exception = e; |
| 95 } | 95 } |
| 96 Expect.equals(true, exception != null); | 96 Expect.equals(true, exception != null); |
| 97 } | 97 } |
| 98 | 98 |
| 99 static void testExpandableList() { | 99 static void testExpandableList() { |
| 100 List list = new List(); | 100 List list = new List(); |
| 101 Expect.equals(true, list.isEmpty()); | 101 Expect.equals(true, list.isEmpty()); |
| 102 Expect.equals(list.length, 0); | 102 Expect.equals(list.length, 0); |
| 103 list.add(4); | 103 list.add(4); |
| (...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 143 } | 143 } |
| 144 } | 144 } |
| 145 | 145 |
| 146 class Yes { | 146 class Yes { |
| 147 operator ==(var other) => true; | 147 operator ==(var other) => true; |
| 148 } | 148 } |
| 149 | 149 |
| 150 main() { | 150 main() { |
| 151 ListTest.testMain(); | 151 ListTest.testMain(); |
| 152 } | 152 } |
| OLD | NEW |