Browse files

Merge pull request #1219 from jacob-carlborg/issue_9794

Fixes Issue 9794 - std.json cannot handle delete character
  • Loading branch information...
2 parents 90b2e94 + a272a59 commit 3724fe54411555d9256afed053aa65c0b7bf8514 @braddr braddr committed Mar 23, 2013
Showing with 9 additions and 1 deletion.
  1. +9 −1 std/json.d
View
10 std/json.d
@@ -20,6 +20,7 @@ module std.json;
import std.ascii;
import std.conv;
import std.range;
+import std.uni : isControl;
import std.utf;
private {
@@ -456,7 +457,12 @@ class JSONException : Exception {
}
}
-version(unittest) import std.stdio;
+version(unittest)
+{
+ import std.exception;
+ import std.stdio;
+}
+
unittest {
// An overly simple test suite, if it can parse a serializated string and
@@ -504,4 +510,6 @@ unittest {
assert(toJSON(&val) == "\"\Α\Β\Γ\"");
val = parseJSON(`"\u2660\u2666"`);
assert(toJSON(&val) == "\"\♠\♦\"");
+
+ assertNotThrown(parseJSON(`{ "foo": "` ~ "\u007F" ~ `"}`));
}

0 comments on commit 3724fe5

Please sign in to comment.