Added test for issue 39229

This commit is contained in:
Nyholm 2020-11-30 11:43:40 +01:00
parent aa5ec20a0c
commit b562a54e53
No known key found for this signature in database
GPG Key ID: 1187B6F70C4F519E
1 changed files with 23 additions and 0 deletions

View File

@ -2671,6 +2671,29 @@ YAML;
);
}
public function testMultipleWhitespaceAtEndOfLine()
{
$yaml = "\nfoo:\n arguments: [ '@bar' ] \n";
$this->assertSame(
[
'foo' => [
'arguments' => ['@bar'],
],
],
$this->parser->parse($yaml)
);
$yaml = "\nfoo:\n bar: {}\n";
$this->assertSame(
[
'foo' => [
'bar' => [],
],
],
$this->parser->parse($yaml)
);
}
/**
* This is a regression test for a bug where a YAML block with a nested multiline string using | was parsed without
* a trailing \n when a shorter YAML document was parsed before.