From 730f4ba826c8b9a0c7b657099916ffbb648dbf95 Mon Sep 17 00:00:00 2001 From: Andre Vehreschild Date: Tue, 19 Apr 2022 18:43:54 +0200 Subject: [PATCH] Add test showing the issue of #1098. Regression reported in #1098 is caused by block values not consuming Breaks in CRNL encoded input data correctly. --- test/integration/load_node_test.cpp | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/test/integration/load_node_test.cpp b/test/integration/load_node_test.cpp index 958e735..9d0c790 100644 --- a/test/integration/load_node_test.cpp +++ b/test/integration/load_node_test.cpp @@ -345,5 +345,20 @@ TEST(NodeTest, LoadTagWithNullScalar) { EXPECT_TRUE(node.IsNull()); } +TEST(LoadNodeTest, BlockCRNLEncoded) { + Node node = Load( + "blockText: |\r\n" + " some arbitrary text \r\n" + " spanning some \r\n" + " lines, that are split \r\n" + " by CR and NL\r\n" + "followup: 1"); + EXPECT_EQ( + "some arbitrary text \nspanning some \nlines, that are split \nby CR and " + "NL\n", + node["blockText"].as()); + EXPECT_EQ(1, node["followup"].as()); +} + } // namespace } // namespace YAML