Permalink
Browse files

Fixes Issue 9794 - std.json cannot handle delete character

  • Loading branch information...
1 parent 7cba78d commit a272a595adbbf4205cfbcd1dade3065f5cd1e532 @jacob-carlborg jacob-carlborg committed Mar 23, 2013
Showing with 9 additions and 1 deletion.
  1. +9 −1 std/json.d
View
@@ -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 a272a59

Please sign in to comment.