Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
Y
yaml-cpp
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
lvzhengyang
yaml-cpp
Commits
b077e839
Commit
b077e839
authored
Oct 20, 2011
by
Jesse Beder
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added parser test for single char input (that fails)
parent
c953ce0b
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
14 additions
and
2 deletions
+14
-2
test/old-api/parsertests.cpp
+14
-2
No files found.
test/old-api/parsertests.cpp
View file @
b077e839
...
@@ -880,6 +880,17 @@ namespace Test
...
@@ -880,6 +880,17 @@ namespace Test
return
false
;
return
false
;
return
true
;
return
true
;
}
}
bool
SingleChar
()
{
std
::
string
input
=
"5"
;
std
::
stringstream
stream
(
input
);
YAML
::
Parser
parser
(
stream
);
YAML
::
Node
doc
;
parser
.
GetNextDocument
(
doc
);
return
doc
.
to
<
int
>
()
==
5
;
}
}
}
namespace
{
namespace
{
...
@@ -930,7 +941,7 @@ namespace Test
...
@@ -930,7 +941,7 @@ namespace Test
}
else
{
}
else
{
std
::
cout
<<
"Parser test failed: "
<<
name
<<
"
\n
"
;
std
::
cout
<<
"Parser test failed: "
<<
name
<<
"
\n
"
;
if
(
error
!=
""
)
if
(
error
!=
""
)
std
::
cout
<<
"Caught exception: "
<<
error
<<
"
\n
"
;
std
::
cout
<<
"
Caught exception: "
<<
error
<<
"
\n
"
;
}
}
total
++
;
total
++
;
}
}
...
@@ -1098,7 +1109,7 @@ namespace Test
...
@@ -1098,7 +1109,7 @@ namespace Test
}
else
{
}
else
{
std
::
cout
<<
"Parser test failed: "
<<
name
<<
"
\n
"
;
std
::
cout
<<
"Parser test failed: "
<<
name
<<
"
\n
"
;
if
(
error
!=
""
)
if
(
error
!=
""
)
std
::
cout
<<
"Caught exception: "
<<
error
<<
"
\n
"
;
std
::
cout
<<
"
Caught exception: "
<<
error
<<
"
\n
"
;
}
}
total
++
;
total
++
;
}
}
...
@@ -1159,6 +1170,7 @@ namespace Test
...
@@ -1159,6 +1170,7 @@ namespace Test
RunParserTest
(
&
Parser
::
Infinity
,
"infinity"
,
passed
,
total
);
RunParserTest
(
&
Parser
::
Infinity
,
"infinity"
,
passed
,
total
);
RunParserTest
(
&
Parser
::
NaN
,
"NaN"
,
passed
,
total
);
RunParserTest
(
&
Parser
::
NaN
,
"NaN"
,
passed
,
total
);
RunParserTest
(
&
Parser
::
NonConstKey
,
"non const key"
,
passed
,
total
);
RunParserTest
(
&
Parser
::
NonConstKey
,
"non const key"
,
passed
,
total
);
RunParserTest
(
&
Parser
::
SingleChar
,
"single char"
,
passed
,
total
);
RunEncodingTest
(
&
EncodeToUtf8
,
false
,
"UTF-8, no BOM"
,
passed
,
total
);
RunEncodingTest
(
&
EncodeToUtf8
,
false
,
"UTF-8, no BOM"
,
passed
,
total
);
RunEncodingTest
(
&
EncodeToUtf8
,
true
,
"UTF-8 with BOM"
,
passed
,
total
);
RunEncodingTest
(
&
EncodeToUtf8
,
true
,
"UTF-8 with BOM"
,
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