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
62761897
Commit
62761897
authored
Nov 08, 2012
by
Jesse Beder
Browse files
Merged ? fix from core
parents
bcdda402
8c517bf0
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
14 additions
and
1 deletion
+14
-1
src/exp.h
src/exp.h
+1
-1
test/core/parsertests.cpp
test/core/parsertests.cpp
+13
-0
No files found.
src/exp.h
View file @
62761897
...
...
@@ -91,7 +91,7 @@ namespace YAML
return
e
;
}
inline
const
RegEx
&
Key
()
{
static
const
RegEx
e
=
RegEx
(
'?'
);
static
const
RegEx
e
=
RegEx
(
'?'
)
+
BlankOrBreak
()
;
return
e
;
}
inline
const
RegEx
&
KeyInFlow
()
{
...
...
test/core/parsertests.cpp
View file @
62761897
...
...
@@ -16,6 +16,18 @@ namespace Test
}
return
" no exception caught"
;
}
TEST
PlainScalarStartingWithQuestionMark
()
{
HANDLE
(
"foo: ?bar"
);
EXPECT_DOC_START
();
EXPECT_MAP_START
(
"?"
,
0
);
EXPECT_SCALAR
(
"?"
,
0
,
"foo"
);
EXPECT_SCALAR
(
"?"
,
0
,
"?bar"
);
EXPECT_MAP_END
();
EXPECT_DOC_END
();
DONE
();
}
}
namespace
{
...
...
@@ -44,6 +56,7 @@ namespace Test
int
passed
=
0
;
int
total
=
0
;
RunParserTest
(
&
Parser
::
NoEndOfMapFlow
,
"No end of map flow"
,
passed
,
total
);
RunParserTest
(
&
Parser
::
PlainScalarStartingWithQuestionMark
,
"Plain scalar starting with question mark"
,
passed
,
total
);
std
::
cout
<<
"Parser tests: "
<<
passed
<<
"/"
<<
total
<<
" passed
\n
"
;
return
passed
==
total
;
...
...
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