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

Unified Diff: tests/language/arithmetic_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_test.dart ('k') | tests/lib/args/args_test.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tests/language/arithmetic_test.dart
diff --git a/tests/language/arithmetic_test.dart b/tests/language/arithmetic_test.dart
index 12cc9912ea7319a4805417f36fd330b917a1e62e..b7d7ce74a6bbb292512ec45ae09cc3442cb7fd0a 100644
--- a/tests/language/arithmetic_test.dart
+++ b/tests/language/arithmetic_test.dart
@@ -9,7 +9,7 @@ class ArithmeticTest {
try {
Math.parseInt(s);
return false;
- } catch (BadNumberFormatException e) {
+ } catch (FormatException e) {
return true;
}
}
@@ -18,18 +18,18 @@ class ArithmeticTest {
try {
Math.parseDouble(s);
return false;
- } catch (BadNumberFormatException e) {
+ } catch (FormatException e) {
return true;
}
}
- static bool toIntThrowsBadNumberFormatException(String str) {
+ static bool toIntThrowsFormatException(String str) {
// No exception allowed for parse double.
double d = Math.parseDouble(str);
try {
var a = d.toInt();
return false;
- } catch (BadNumberFormatException e) {
+ } catch (FormatException e) {
return true;
}
}
@@ -145,7 +145,7 @@ class ArithmeticTest {
Expect.isFalse(negateDouble(-0.0).isNegative());
Expect.isTrue(negateDouble(3.5e3).isNegative());
Expect.isFalse(negateDouble(-3.5e3).isNegative());
-
+
// Constants.
final nan = 0.0/0.0;
@@ -385,10 +385,10 @@ class ArithmeticTest {
Expect.equals("Infinity", Math.parseDouble("Infinity").toString());
Expect.equals("-Infinity", Math.parseDouble("-Infinity").toString());
- Expect.equals(false, toIntThrowsBadNumberFormatException("1.2"));
- Expect.equals(true, toIntThrowsBadNumberFormatException("Infinity"));
- Expect.equals(true, toIntThrowsBadNumberFormatException("-Infinity"));
- Expect.equals(true, toIntThrowsBadNumberFormatException("NaN"));
+ Expect.equals(false, toIntThrowsFormatException("1.2"));
+ Expect.equals(true, toIntThrowsFormatException("Infinity"));
+ Expect.equals(true, toIntThrowsFormatException("-Infinity"));
+ Expect.equals(true, toIntThrowsFormatException("NaN"));
// Min/max
Expect.equals(1, Math.min(1, 12));
« no previous file with comments | « tests/corelib/math_test.dart ('k') | tests/lib/args/args_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698