Fix single cr not recognized (#1094)

Complies with YAML Standard [5.4](https://yaml.org/spec/1.2.2/#54-line-break-characters) [25] instead of matching `\r` only in combination with `\n`.
This commit is contained in:
Dr. Andre Vehreschild
2022-04-01 05:16:35 +02:00
committed by GitHub
parent 669af4eb55
commit a6db7e32ac
2 changed files with 9 additions and 1 deletions

View File

@@ -968,6 +968,14 @@ TEST_F(EmitterTest, UserType) {
ExpectEmit("- x: 5\n bar: hello\n- x: 3\n bar: goodbye");
}
TEST_F(EmitterTest, UserType2) {
out << BeginSeq;
out << Foo(5, "\r");
out << EndSeq;
ExpectEmit("- x: 5\n bar: \"\\r\"");
}
TEST_F(EmitterTest, UserTypeInContainer) {
std::vector<Foo> fv;
fv.push_back(Foo(5, "hello"));