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

Unified Diff: tests/lib/convert/json_test.dart

Issue 136373002: Fix JSON encoder accepting NaN and Infinity. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 years, 11 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/lib/convert/json_lib_test.dart ('k') | tests/lib/convert/json_util_test.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tests/lib/convert/json_test.dart
diff --git a/tests/corelib/json_test.dart b/tests/lib/convert/json_test.dart
similarity index 97%
rename from tests/corelib/json_test.dart
rename to tests/lib/convert/json_test.dart
index 86485e02404e8bc02562a92746fdecfd2a0f874f..4470535578aced1a25d1298013c4a70609ffd69d 100644
--- a/tests/corelib/json_test.dart
+++ b/tests/lib/convert/json_test.dart
@@ -135,6 +135,13 @@ testNumbers() {
testThrows("[2.,2]");
testThrows("{2.:2}");
+
+ testThrows("NaN");
+ testThrows("Infinity");
+ testThrows("-Infinity");
+ Expect.throws(() => JSON.encode(double.NAN));
+ Expect.throws(() => JSON.encode(double.INFINITY));
+ Expect.throws(() => JSON.encode(double.NEGATIVE_INFINITY));
}
testStrings() {
« no previous file with comments | « tests/lib/convert/json_lib_test.dart ('k') | tests/lib/convert/json_util_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698