mirror of
https://github.com/jbeder/yaml-cpp.git
synced 2025-09-09 12:41:17 +00:00
Improve build and fix single cr on windows (#1099)
This commit is contained in:

committed by
GitHub

parent
7d06655611
commit
4c982d59dc
@@ -37,7 +37,7 @@ inline const RegEx& Blank() {
|
|||||||
return e;
|
return e;
|
||||||
}
|
}
|
||||||
inline const RegEx& Break() {
|
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;
|
return e;
|
||||||
}
|
}
|
||||||
inline const RegEx& BlankOrBreak() {
|
inline const RegEx& BlankOrBreak() {
|
||||||
|
@@ -345,5 +345,20 @@ TEST(NodeTest, LoadTagWithNullScalar) {
|
|||||||
EXPECT_TRUE(node.IsNull());
|
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
|
||||||
} // namespace YAML
|
} // namespace YAML
|
||||||
|
Reference in New Issue
Block a user