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

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

Issue 12743005: Revert "Remove Expect from core library." (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Reupload (first upload failed). Created 7 years, 9 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) 2012, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2012, 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 import "package:expect/expect.dart";
6
7 void main() { 5 void main() {
8 bool checkedMode = false; 6 bool checkedMode = false;
9 assert(checkedMode = true); 7 assert(checkedMode = true);
10 8
11 for (int i = 0; i < 36 * 36 + 1; i++) { 9 for (int i = 0; i < 36 * 36 + 1; i++) {
12 for (int r = 2; r <= 36; r++) { 10 for (int r = 2; r <= 36; r++) {
13 String radixString = i.toRadixString(r); 11 String radixString = i.toRadixString(r);
14 Expect.equals(i, int.parse(radixString, radix: r), ""); 12 Expect.equals(i, int.parse(radixString, radix: r), "");
15 Expect.equals(i, int.parse(" $radixString", radix: r), ""); 13 Expect.equals(i, int.parse(" $radixString", radix: r), "");
16 Expect.equals(i, int.parse("$radixString ", radix: r), ""); 14 Expect.equals(i, int.parse("$radixString ", radix: r), "");
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after
81 testBadArguments("0", 0); 79 testBadArguments("0", 0);
82 testBadArguments("0", 1); 80 testBadArguments("0", 1);
83 testBadArguments("0", 37); 81 testBadArguments("0", 37);
84 82
85 // If handleError isn't an unary function, and it's called, it also throws 83 // If handleError isn't an unary function, and it's called, it also throws
86 // (either TypeError in checked mode, or some failure in unchecked mode). 84 // (either TypeError in checked mode, or some failure in unchecked mode).
87 Expect.throws(() => int.parse("9", radix: 8, onError: "not a function")); 85 Expect.throws(() => int.parse("9", radix: 8, onError: "not a function"));
88 Expect.throws(() => int.parse("9", radix: 8, onError: () => 42)); 86 Expect.throws(() => int.parse("9", radix: 8, onError: () => 42));
89 Expect.throws(() => int.parse("9", radix: 8, onError: (v1, v2) => 42)); 87 Expect.throws(() => int.parse("9", radix: 8, onError: (v1, v2) => 42));
90 } 88 }
OLDNEW
« no previous file with comments | « tests/corelib/indexed_list_access_test.dart ('k') | tests/corelib/integer_to_radix_string_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698