Skip to content

Commit

Permalink
Add test
Browse files Browse the repository at this point in the history
  • Loading branch information
Himura2la committed Oct 27, 2020
1 parent 4459888 commit dff0dad
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 1 deletion.
13 changes: 13 additions & 0 deletions YamlDotNet.Test/Core/EmitterTests.cs
Expand Up @@ -208,6 +208,19 @@ public void FoldedStyleIsSelectedWhenNewLinesAreFoundInLiteral()
yaml.Should().Contain(">");
}


[Fact]
[Trait("motive", "pr #540")]
public void AllowBlockStyleInMultilineScalarsWithTrailingSpaces()
{
var events = SequenceWith(Scalar("hello \nworld").ImplicitPlain);

var yaml = EmittedTextFrom(StreamedDocumentWith(events));

yaml.Should().Contain("\n");
}


[Fact]
public void FoldedStyleDoesNotGenerateExtraLineBreaks()
{
Expand Down
2 changes: 1 addition & 1 deletion YamlDotNet.Test/Yaml.cs
Expand Up @@ -103,7 +103,7 @@ public static string Text(string yamlText)
}

lines = lines
.Select(l => l.Substring(indent.Groups[1].Length))
.Select(l => l.Length > 0 ? l.Substring(indent.Groups[1].Length) : l)
.ToList();
}

Expand Down

0 comments on commit dff0dad

Please sign in to comment.