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

Side by Side Diff: tests/corelib/big_integer_vm_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
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 // Testing Bigints. 4 // Testing Bigints.
5 // TODO(srdjan): Make sure the numbers are Bigint and not Mint or Smi. 5 // TODO(srdjan): Make sure the numbers are Bigint and not Mint or Smi.
6 6
7 #library("BigIntegerTest.dart"); 7 #library("BigIntegerTest.dart");
8 #import("dart:coreimpl"); 8 #import("dart:coreimpl");
9 9
10 class BigIntegerTest { 10 class BigIntegerTest {
(...skipping 125 matching lines...) Expand 10 before | Expand all | Expand 10 after
136 Expect.equals(0, a & b); 136 Expect.equals(0, a & b);
137 Expect.equals(-1, a | b); 137 Expect.equals(-1, a | b);
138 } 138 }
139 139
140 static testShiftAmount() { 140 static testShiftAmount() {
141 Expect.equals(0, 12 >> 111111111111111111111111111111); 141 Expect.equals(0, 12 >> 111111111111111111111111111111);
142 Expect.equals(-1, -12 >> 111111111111111111111111111111); 142 Expect.equals(-1, -12 >> 111111111111111111111111111111);
143 bool exceptionCaught = false; 143 bool exceptionCaught = false;
144 try { 144 try {
145 var a = 1 << 1111111111111111111111111111; 145 var a = 1 << 1111111111111111111111111111;
146 } catch (OutOfMemoryException e) { 146 } on OutOfMemoryException catch (e) {
147 exceptionCaught = true; 147 exceptionCaught = true;
148 } 148 }
149 Expect.equals(true, exceptionCaught); 149 Expect.equals(true, exceptionCaught);
150 } 150 }
151 151
152 static testMain() { 152 static testMain() {
153 Expect.equals(1234567890123456789, foo()); 153 Expect.equals(1234567890123456789, foo());
154 testSmiOverflow(); 154 testSmiOverflow();
155 testBigintAdd(); 155 testBigintAdd();
156 testBigintSub(); 156 testBigintSub();
(...skipping 10 matching lines...) Expand all
167 checkBigint(a); 167 checkBigint(a);
168 checkBigint(b); 168 checkBigint(b);
169 Expect.equals(false, a.hashCode() == b.hashCode()); 169 Expect.equals(false, a.hashCode() == b.hashCode());
170 Expect.equals(true, a.hashCode() == (b - 1).hashCode()); 170 Expect.equals(true, a.hashCode() == (b - 1).hashCode());
171 } 171 }
172 } 172 }
173 173
174 main() { 174 main() {
175 BigIntegerTest.testMain(); 175 BigIntegerTest.testMain();
176 } 176 }
OLDNEW
« no previous file with comments | « tests/compiler/dart2js_native/native_null_closure_frog_test.dart ('k') | tests/corelib/const_list_literal_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698