mirror of
https://github.com/composer/composer
synced 2025-05-09 00:22:53 +00:00
Add detection for extra commas in arrays
This commit is contained in:
parent
6f1dab6233
commit
f5aa3e6c79
2 changed files with 11 additions and 1 deletions
|
@ -24,6 +24,16 @@ class JsonFileTest extends \PHPUnit_Framework_TestCase
|
|||
$this->expectParseException('extra comma on line 2, char 21', $json);
|
||||
}
|
||||
|
||||
public function testParseErrorDetectExtraCommaInArray()
|
||||
{
|
||||
$json = '{
|
||||
"foo": [
|
||||
"bar",
|
||||
]
|
||||
}';
|
||||
$this->expectParseException('extra comma on line 3, char 18', $json);
|
||||
}
|
||||
|
||||
public function testParseErrorDetectSingleQuotes()
|
||||
{
|
||||
$json = '{
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue