Skip to content

Commit 2586fca

Browse files
committed
Added the test for a json string with one char
1 parent db97579 commit 2586fca

1 file changed

Lines changed: 9 additions & 1 deletion

File tree

test/JsonMachineTest/TokensTest.php

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -218,10 +218,18 @@ public function testGetPositionNoDebugging()
218218
$this->assertSame(0, $tokens->getPosition());
219219
}
220220

221+
public function testOneCharString()
222+
{
223+
$tokens = new Tokens(['["o"]']);
224+
$result = iterator_to_array($tokens, false);
225+
226+
$this->assertSame(['[', '"o"', ']'], $result);
227+
}
228+
221229
public function jsonFilesWithDifferentLineEndings()
222230
{
223231
return [
224-
// 'cr new lines' => [__DIR__.'/formatted-cr.json'],
232+
'cr new lines' => [__DIR__.'/formatted-cr.json'],
225233
'lf new lines' => [__DIR__.'/formatted-lf.json'],
226234
'crlf new lines' => [__DIR__.'/formatted-crlf.json'],
227235
];

0 commit comments

Comments
 (0)