Skip to content

Commit 8cac71f

Browse files
committed
Added test for issue 39229
1 parent 7531361 commit 8cac71f

File tree

1 file changed

+23
-0
lines changed

1 file changed

+23
-0
lines changed

Tests/ParserTest.php

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2671,6 +2671,29 @@ public function testParseValueWithNegativeModifiers()
26712671
);
26722672
}
26732673

2674+
public function testMultipleWhitespaceAtEndOfLine()
2675+
{
2676+
$yaml = "\nfoo:\n arguments: [ '@bar' ] \n";
2677+
$this->assertSame(
2678+
[
2679+
'foo' => [
2680+
'arguments' => ['@bar'],
2681+
],
2682+
],
2683+
$this->parser->parse($yaml)
2684+
);
2685+
2686+
$yaml = "\nfoo:\n bar: {}\n";
2687+
$this->assertSame(
2688+
[
2689+
'foo' => [
2690+
'bar' => [],
2691+
],
2692+
],
2693+
$this->parser->parse($yaml)
2694+
);
2695+
}
2696+
26742697
/**
26752698
* This is a regression test for a bug where a YAML block with a nested multiline string using | was parsed without
26762699
* a trailing \n when a shorter YAML document was parsed before.

0 commit comments

Comments
 (0)