Skip to content

Commit

Permalink
This is the expected result when using the yaml extension.
Browse files Browse the repository at this point in the history
Since this extension is based on libyaml, it should be the reference.
  • Loading branch information
yunosh committed Mar 20, 2017
1 parent 16104d8 commit b2e3dda
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
4 changes: 3 additions & 1 deletion framework/Yaml/test/Horde/Yaml/DumperTest.php
Expand Up @@ -208,7 +208,9 @@ public function testShouldNotWrapStringsWithCommentDelimiterForFoldedStrings()
$actual = $this->dumper->dump($value);
$this->assertEquals($expected, $actual);
// round-trip assert
$this->assertEquals($value, Horde_Yaml::load($actual), "Error: expected: " . print_r($value, true) . ", actual: " . print_r(Horde_Yaml::load($actual), true) . ", from: >" . $actual . "<"); // fails presently due to bug in loader which causes an extra "\n" at end of string
// parsing keeps trailing newlines.
$value['foo'] .= "\n";
$this->assertEquals($value, Horde_Yaml::load($actual));
}

}
4 changes: 2 additions & 2 deletions framework/Yaml/test/Horde/Yaml/LoaderTest.php
Expand Up @@ -217,7 +217,7 @@ public function testMappedValueWithFoldedBlock()
{
$parsed = Horde_Yaml::loadFile($this->fixture('basic'));

$expected = "There isn't any time for your tricks!\nDo you understand?\n";
$expected = "There isn't any time for your tricks!\n Do you understand?\n\n";
$actual = $parsed['no time'];
$this->assertEquals($expected, $actual);
}
Expand Down Expand Up @@ -800,7 +800,7 @@ public function testUnfolding()
public function testUnliteralizing()
{
$parsed = Horde_Yaml::loadFile($this->fixture('basic'));
$expected = "Line #1\nLine #2";
$expected = "Line #1\nLine #2\n";
$this->assertEquals($expected, $parsed['literalStringTest']);
}

Expand Down

0 comments on commit b2e3dda

Please sign in to comment.