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
e523312f
Unverified
Commit
e523312f
authored
Aug 03, 2017
by
Niels Lohmann
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
✅
improved test coverage
parent
d2c35929
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
17 additions
and
0 deletions
+17
-0
unit-modifiers.cpp
test/src/unit-modifiers.cpp
+17
-0
No files found.
test/src/unit-modifiers.cpp
View file @
e523312f
...
@@ -752,6 +752,19 @@ TEST_CASE("modifiers")
...
@@ -752,6 +752,19 @@ TEST_CASE("modifiers")
{
{
j_object1
.
update
(
j_object2
);
j_object1
.
update
(
j_object2
);
CHECK
(
j_object1
==
json
({{
"one"
,
"eins"
},
{
"two"
,
"zwo"
},
{
"three"
,
"drei"
}}));
CHECK
(
j_object1
==
json
({{
"one"
,
"eins"
},
{
"two"
,
"zwo"
},
{
"three"
,
"drei"
}}));
json
j_null
;
j_null
.
update
(
j_object2
);
CHECK
(
j_null
==
j_object2
);
}
SECTION
(
"wrong types"
)
{
CHECK_THROWS_AS
(
j_array
.
update
(
j_object1
),
json
::
type_error
&
);
CHECK_THROWS_WITH
(
j_array
.
update
(
j_object1
),
"[json.exception.type_error.305] cannot use merge() with array"
);
CHECK_THROWS_AS
(
j_object1
.
update
(
j_array
),
json
::
type_error
&
);
CHECK_THROWS_WITH
(
j_object1
.
update
(
j_array
),
"[json.exception.type_error.305] cannot use merge() with array"
);
}
}
}
}
...
@@ -761,6 +774,10 @@ TEST_CASE("modifiers")
...
@@ -761,6 +774,10 @@ TEST_CASE("modifiers")
{
{
j_object1
.
update
(
j_object2
.
begin
(),
j_object2
.
end
());
j_object1
.
update
(
j_object2
.
begin
(),
j_object2
.
end
());
CHECK
(
j_object1
==
json
({{
"one"
,
"eins"
},
{
"two"
,
"zwo"
},
{
"three"
,
"drei"
}}));
CHECK
(
j_object1
==
json
({{
"one"
,
"eins"
},
{
"two"
,
"zwo"
},
{
"three"
,
"drei"
}}));
json
j_null
;
j_null
.
update
(
j_object2
.
begin
(),
j_object2
.
end
());
CHECK
(
j_null
==
j_object2
);
}
}
SECTION
(
"empty range"
)
SECTION
(
"empty range"
)
...
...
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