"git@developer.sourcefind.cn:gaoqiong/composable_kernel.git" did not exist on "35f95fe9b8a53927688b3ba0cbc234190b7a27c1"
Unverified Commit 4c982d59 authored by Dr. Andre Vehreschild's avatar Dr. Andre Vehreschild Committed by GitHub
Browse files

Improve build and fix single cr on windows (#1099)

parent 7d066556
......@@ -37,7 +37,7 @@ inline const RegEx& Blank() {
return e;
}
inline const RegEx& Break() {
static const RegEx e = RegEx('\n') | RegEx("\r");
static const RegEx e = RegEx('\n') | RegEx("\r\n") | RegEx('\r');
return e;
}
inline const RegEx& BlankOrBreak() {
......
......@@ -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<std::string>());
EXPECT_EQ(1, node["followup"].as<int>());
}
} // namespace
} // namespace YAML
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment