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

Side by Side Diff: tests/corelib/set_iterator_test.dart

Issue 10891020: Update almost all tests (except co19) to use the new try-catch syntax. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Merge. Created 8 years, 3 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 | Annotate | Revision Log
« no previous file with comments | « tests/corelib/reg_exp5_test.dart ('k') | tests/corelib/string_base_vm_test.dart » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 class FixedHashCode implements Hashable { 5 class FixedHashCode implements Hashable {
6 final int _hashCode; 6 final int _hashCode;
7 const FixedHashCode(this._hashCode); 7 const FixedHashCode(this._hashCode);
8 int hashCode() { return _hashCode; } 8 int hashCode() { return _hashCode; }
9 } 9 }
10 10
11 class SetIteratorTest { 11 class SetIteratorTest {
12 static testMain() { 12 static testMain() {
13 testSmallSet(); 13 testSmallSet();
14 testLargeSet(); 14 testLargeSet();
15 testEmptySet(); 15 testEmptySet();
16 testSetWithDeletedEntries(); 16 testSetWithDeletedEntries();
17 testBug5116829(); 17 testBug5116829();
18 testDifferentSizes(); 18 testDifferentSizes();
19 testDifferentHashCodes(); 19 testDifferentHashCodes();
20 } 20 }
21 21
22 static void testThrows(Iterator<int> it) { 22 static void testThrows(Iterator<int> it) {
23 Expect.equals(false, it.hasNext()); 23 Expect.equals(false, it.hasNext());
24 var exception = null; 24 var exception = null;
25 try { 25 try {
26 it.next(); 26 it.next();
27 } catch (NoMoreElementsException e) { 27 } on NoMoreElementsException catch (e) {
28 exception = e; 28 exception = e;
29 } 29 }
30 Expect.equals(true, exception != null); 30 Expect.equals(true, exception != null);
31 } 31 }
32 32
33 static int sum(int expected, Iterator<int> it) { 33 static int sum(int expected, Iterator<int> it) {
34 int count = 0; 34 int count = 0;
35 while (it.hasNext()) { 35 while (it.hasNext()) {
36 count += it.next(); 36 count += it.next();
37 } 37 }
(...skipping 102 matching lines...) Expand 10 before | Expand all | Expand 10 after
140 Expect.equals(true, x === element); 140 Expect.equals(true, x === element);
141 } 141 }
142 Expect.equals(true, foundIt); 142 Expect.equals(true, foundIt);
143 } 143 }
144 } 144 }
145 } 145 }
146 146
147 main() { 147 main() {
148 SetIteratorTest.testMain(); 148 SetIteratorTest.testMain();
149 } 149 }
OLDNEW
« no previous file with comments | « tests/corelib/reg_exp5_test.dart ('k') | tests/corelib/string_base_vm_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698