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

Fixed json encoding when quoted value contained trailing backslash.

Condition checking if current character is inside a quoted string did not consider the case when backslash before quote is escaped with another backslash.
This commit is contained in:
Jakub Zalas 2012-01-19 00:01:56 +00:00
parent 4dee2528e9
commit c680ec7e51
2 changed files with 10 additions and 1 deletions

View file

@ -93,6 +93,15 @@ class JsonFileTest extends \PHPUnit_Framework_TestCase
$this->assertJsonFormat($json, $data);
}
public function testTrailingBackslash()
{
$data = array('Metadata\\' => 'src/');
$json = '{
"Metadata\\\\": "src\/"
}';
$this->assertJsonFormat($json, $data);
}
private function expectParseException($text, $json)
{
try {