Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
gaoqiong
yaml-cpp
Commits
4c982d59
Unverified
Commit
4c982d59
authored
Apr 19, 2022
by
Dr. Andre Vehreschild
Committed by
GitHub
Apr 19, 2022
Browse files
Improve build and fix single cr on windows (#1099)
parent
7d066556
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
16 additions
and
1 deletion
+16
-1
src/exp.h
src/exp.h
+1
-1
test/integration/load_node_test.cpp
test/integration/load_node_test.cpp
+15
-0
No files found.
src/exp.h
View file @
4c982d59
...
@@ -37,7 +37,7 @@ inline const RegEx& Blank() {
...
@@ -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
()
{
...
...
test/integration/load_node_test.cpp
View file @
4c982d59
...
@@ -345,5 +345,20 @@ TEST(NodeTest, LoadTagWithNullScalar) {
...
@@ -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
\n
spanning some
\n
lines, that are split
\n
by CR and "
"NL
\n
"
,
node
[
"blockText"
].
as
<
std
::
string
>
());
EXPECT_EQ
(
1
,
node
[
"followup"
].
as
<
int
>
());
}
}
// namespace
}
// namespace
}
// namespace YAML
}
// namespace YAML
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment