Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F15408544
D9638.id.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
1 KB
Referenced Files
None
Subscribers
None
D9638.id.diff
View Options
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) {
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Wed, Mar 19, 11:45 PM (2 d, 12 h ago)
Storage Engine
blob
Storage Format
Encrypted (AES-256-CBC)
Storage Handle
7698816
Default Alt Text
D9638.id.diff (1 KB)
Attached To
Mode
D9638: Add more unit tests for `PhutilJSONParser`.
Attached
Detach File
Event Timeline
Log In to Comment