1
0
Fork 0
mirror of https://github.com/composer/composer synced 2025-05-09 00:22:53 +00:00

Add detection for unescaped backslashes

This commit is contained in:
Jordi Boggiano 2011-11-01 16:02:56 +01:00
parent f5aa3e6c79
commit 066a0db752
2 changed files with 10 additions and 0 deletions

View file

@ -34,6 +34,14 @@ class JsonFileTest extends \PHPUnit_Framework_TestCase
$this->expectParseException('extra comma on line 3, char 18', $json);
}
public function testParseErrorDetectUnescapedBackslash()
{
$json = '{
"fo\o": "bar"
}';
$this->expectParseException('unescaped backslash (\\) on line 2, char 12', $json);
}
public function testParseErrorDetectSingleQuotes()
{
$json = '{