Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
J
json
Project
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
Chen Yisong
json
Commits
f585fe4e
Commit
f585fe4e
authored
Oct 02, 2017
by
Perry Kundert
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Test to confirm parsing of multiple JSON records in a istream #367
parent
90adf6ec
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
20 additions
and
0 deletions
+20
-0
unit-regression.cpp
test/src/unit-regression.cpp
+20
-0
No files found.
test/src/unit-regression.cpp
View file @
f585fe4e
...
...
@@ -1233,4 +1233,24 @@ TEST_CASE("regression tests")
"[json.exception.type_error.302] type must be array, but is null"
);
}
}
SECTION
(
"issue #367 - Behavior of operator>> should more closely resemble that of built-in overloads."
)
{
SECTION
(
"example 1"
)
{
std
::
istringstream
i1_2_3
(
"{
\"
first
\"
:
\"
one
\"
}{
\"
second
\"
:
\"
two
\"
}3"
);
json
j1
,
j2
,
j3
;
i1_2_3
>>
j1
;
i1_2_3
>>
j2
;
i1_2_3
>>
j3
;
std
::
map
<
std
::
string
,
std
::
string
>
m1
=
j1
;
std
::
map
<
std
::
string
,
std
::
string
>
m2
=
j2
;
int
i3
=
j3
;
CHECK
(
m1
==
(
std
::
map
<
std
::
string
,
std
::
string
>
{{
"first"
,
"one"
}}
));
CHECK
(
m2
==
(
std
::
map
<
std
::
string
,
std
::
string
>
{{
"second"
,
"two"
}}
));
CHECK
(
i3
==
3
);
}
}
}
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