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

Unified Diff: tests/corelib/math_test.dart

Issue 10850034: Rename BadNumberFormatException -> FormatException. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Rebase. Created 8 years, 4 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « tests/corelib/math_parse_double_test.dart ('k') | tests/language/arithmetic_test.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tests/corelib/math_test.dart
diff --git a/tests/corelib/math_test.dart b/tests/corelib/math_test.dart
index 651587245a3c2570686c1dd16ef6bac012bb6e00..0c2e6a96df0bcae74c6d11f5b4aba6de83eec342 100644
--- a/tests/corelib/math_test.dart
+++ b/tests/corelib/math_test.dart
@@ -148,11 +148,11 @@ class MathTest {
checkVeryClose(Math.SQRT1_2, Math.pow(0.5, 0.5));
}
- static bool parseIntThrowsBadNumberFormatException(str) {
+ static bool parseIntThrowsFormatException(str) {
try {
Math.parseInt(str);
return false;
- } catch (BadNumberFormatException e) {
+ } catch (FormatException e) {
return true;
}
}
@@ -202,37 +202,37 @@ class MathTest {
Expect.equals(9, Math.parseInt("09"));
Expect.equals(9, Math.parseInt(" 09 "));
Expect.equals(-9, Math.parseInt("-09"));
- Expect.equals(true, parseIntThrowsBadNumberFormatException("1b"));
- Expect.equals(true, parseIntThrowsBadNumberFormatException(" 1b "));
- Expect.equals(true, parseIntThrowsBadNumberFormatException(" 1 b "));
- Expect.equals(true, parseIntThrowsBadNumberFormatException("1e2"));
- Expect.equals(true, parseIntThrowsBadNumberFormatException(" 1e2 "));
- Expect.equals(true, parseIntThrowsBadNumberFormatException("00x12"));
- Expect.equals(true, parseIntThrowsBadNumberFormatException(" 00x12 "));
- Expect.equals(true, parseIntThrowsBadNumberFormatException("-1b"));
- Expect.equals(true, parseIntThrowsBadNumberFormatException(" -1b "));
- Expect.equals(true, parseIntThrowsBadNumberFormatException(" -1 b "));
- Expect.equals(true, parseIntThrowsBadNumberFormatException("-1e2"));
- Expect.equals(true, parseIntThrowsBadNumberFormatException(" -1e2 "));
- Expect.equals(true, parseIntThrowsBadNumberFormatException("-00x12"));
- Expect.equals(true, parseIntThrowsBadNumberFormatException(" -00x12 "));
- Expect.equals(true, parseIntThrowsBadNumberFormatException(" -00x12 "));
- Expect.equals(true, parseIntThrowsBadNumberFormatException("0x0x12"));
- Expect.equals(true, parseIntThrowsBadNumberFormatException("0.1"));
- Expect.equals(true, parseIntThrowsBadNumberFormatException("0x3.1"));
- Expect.equals(true, parseIntThrowsBadNumberFormatException("5."));
- Expect.equals(true, parseIntThrowsBadNumberFormatException("+-5"));
- Expect.equals(true, parseIntThrowsBadNumberFormatException("-+5"));
- Expect.equals(true, parseIntThrowsBadNumberFormatException("--5"));
- Expect.equals(true, parseIntThrowsBadNumberFormatException("++5"));
- Expect.equals(true, parseIntThrowsBadNumberFormatException("+ 5"));
- Expect.equals(true, parseIntThrowsBadNumberFormatException("- 5"));
- Expect.equals(true, parseIntThrowsBadNumberFormatException(""));
- Expect.equals(true, parseIntThrowsBadNumberFormatException(" "));
- Expect.equals(true, parseIntThrowsBadNumberFormatException("+0x1234567890"));
- Expect.equals(true, parseIntThrowsBadNumberFormatException(" +0x1234567890 "));
- Expect.equals(true, parseIntThrowsBadNumberFormatException("+0x100"));
- Expect.equals(true, parseIntThrowsBadNumberFormatException(" +0x100 "));
+ Expect.equals(true, parseIntThrowsFormatException("1b"));
+ Expect.equals(true, parseIntThrowsFormatException(" 1b "));
+ Expect.equals(true, parseIntThrowsFormatException(" 1 b "));
+ Expect.equals(true, parseIntThrowsFormatException("1e2"));
+ Expect.equals(true, parseIntThrowsFormatException(" 1e2 "));
+ Expect.equals(true, parseIntThrowsFormatException("00x12"));
+ Expect.equals(true, parseIntThrowsFormatException(" 00x12 "));
+ Expect.equals(true, parseIntThrowsFormatException("-1b"));
+ Expect.equals(true, parseIntThrowsFormatException(" -1b "));
+ Expect.equals(true, parseIntThrowsFormatException(" -1 b "));
+ Expect.equals(true, parseIntThrowsFormatException("-1e2"));
+ Expect.equals(true, parseIntThrowsFormatException(" -1e2 "));
+ Expect.equals(true, parseIntThrowsFormatException("-00x12"));
+ Expect.equals(true, parseIntThrowsFormatException(" -00x12 "));
+ Expect.equals(true, parseIntThrowsFormatException(" -00x12 "));
+ Expect.equals(true, parseIntThrowsFormatException("0x0x12"));
+ Expect.equals(true, parseIntThrowsFormatException("0.1"));
+ Expect.equals(true, parseIntThrowsFormatException("0x3.1"));
+ Expect.equals(true, parseIntThrowsFormatException("5."));
+ Expect.equals(true, parseIntThrowsFormatException("+-5"));
+ Expect.equals(true, parseIntThrowsFormatException("-+5"));
+ Expect.equals(true, parseIntThrowsFormatException("--5"));
+ Expect.equals(true, parseIntThrowsFormatException("++5"));
+ Expect.equals(true, parseIntThrowsFormatException("+ 5"));
+ Expect.equals(true, parseIntThrowsFormatException("- 5"));
+ Expect.equals(true, parseIntThrowsFormatException(""));
+ Expect.equals(true, parseIntThrowsFormatException(" "));
+ Expect.equals(true, parseIntThrowsFormatException("+0x1234567890"));
+ Expect.equals(true, parseIntThrowsFormatException(" +0x1234567890 "));
+ Expect.equals(true, parseIntThrowsFormatException("+0x100"));
+ Expect.equals(true, parseIntThrowsFormatException(" +0x100 "));
}
static testMain() {
« no previous file with comments | « tests/corelib/math_parse_double_test.dart ('k') | tests/language/arithmetic_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698