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

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

Issue 12212016: Remove Expect from core library. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Add deprecation comment for ExpectException and revert one test. Created 7 years, 8 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
5 main() { 7 main() {
6 // Test that we accept radix 2 to 36 and that we use lower-case 8 // Test that we accept radix 2 to 36 and that we use lower-case
7 // letters. 9 // letters.
8 var expected = ['0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 10 var expected = ['0', '1', '2', '3', '4', '5', '6', '7', '8', '9',
9 'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 11 'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j',
10 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 12 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't',
11 'u', 'v', 'w', 'x', 'y', 'z']; 13 'u', 'v', 'w', 'x', 'y', 'z'];
12 for (var radix = 2; radix < 37; radix++) { 14 for (var radix = 2; radix < 37; radix++) {
13 for (var i = 0; i < radix; i++) { 15 for (var i = 0; i < radix; i++) {
14 Expect.equals(expected[i], i.toRadixString(radix)); 16 Expect.equals(expected[i], i.toRadixString(radix));
15 } 17 }
16 } 18 }
17 19
18 var illegalRadices = [ -1, 0, 1, 37 ]; 20 var illegalRadices = [ -1, 0, 1, 37 ];
19 for (var radix in illegalRadices) { 21 for (var radix in illegalRadices) {
20 try { 22 try {
21 42.toRadixString(radix); 23 42.toRadixString(radix);
22 Expect.fail("Exception expected"); 24 Expect.fail("Exception expected");
23 } on ArgumentError catch (e) { 25 } on ArgumentError catch (e) {
24 // Nothing to do. 26 // Nothing to do.
25 } 27 }
26 } 28 }
27 } 29 }
OLDNEW
« no previous file with comments | « tests/corelib/int_parse_radix_test.dart ('k') | tests/corelib/is_operator_basic_types_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698