diff --git a/src/parser/__tests__/PhutilJSONParserTestCase.php b/src/parser/__tests__/PhutilJSONParserTestCase.php --- a/src/parser/__tests__/PhutilJSONParserTestCase.php +++ b/src/parser/__tests__/PhutilJSONParserTestCase.php @@ -16,6 +16,12 @@ '{"foo": "bar", "bar": {"baz": "foo"}}' => array('foo' => 'bar', 'bar' => array('baz' => 'foo')), '{"": ""}' => array('' => ''), + '{"test":"\u00c9v\u00e9nement"}' + => array('test' => "\xC3\x89v\xC3\xA9nement"), + '["\u00c9v\u00e9nement"]' => array("\xC3\x89v\xC3\xA9nement"), + '{"test":"http:\/\/foo\\\\zomg"}' + => array('test' => 'http://foo\\zomg'), + '["http:\/\/foo\\\\zomg"]' => array('http://foo\\zomg'), ); foreach ($tests as $input => $expect) { @@ -70,6 +76,16 @@ 'char' => 1, 'token' => 'INVALID', ), + "{\"foo\": \"bar\nbaz\"}" => array( + 'line' => 1, + 'char' => 7, + 'token' => 'INVALID', + ), + '{"foo": "bar\z"}' => array( + 'line' => 1, + 'char' => 7, + 'token' => 'INVALID', + ), ); foreach ($tests as $input => $expected) {