Skip to content

Commit 9199327

Browse files
author
maxime.steinhausser
committed
[Yaml] Add regression test for comments indents
1 parent 71960c2 commit 9199327

File tree

1 file changed

+26
-0
lines changed

1 file changed

+26
-0
lines changed

Tests/ParserTest.php

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -560,6 +560,32 @@ public function testEmptyValue()
560560
$this->assertEquals(array('hash' => null), Yaml::parse($input));
561561
}
562562

563+
public function testCommentAtTheRootIndent()
564+
{
565+
$this->assertEquals(array(
566+
'services' => array(
567+
'app.foo_service' => array(
568+
'class' => 'Foo',
569+
),
570+
'app/bar_service' => array(
571+
'class' => 'Bar',
572+
),
573+
),
574+
), Yaml::parse(<<<EOF
575+
# comment 1
576+
services:
577+
# comment 2
578+
# comment 3
579+
app.foo_service:
580+
class: Foo
581+
# comment 4
582+
# comment 5
583+
app/bar_service:
584+
class: Bar
585+
EOF
586+
));
587+
}
588+
563589
public function testStringBlockWithComments()
564590
{
565591
$this->assertEquals(array('content' => <<<EOT

0 commit comments

Comments
 (0)