Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
J
json
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Libraries
json
Commits
9e8e1133
Commit
9e8e1133
authored
Apr 08, 2015
by
Niels
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
improved test case coverage
parent
1bdb6acb
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
13 additions
and
1 deletion
+13
-1
README.md
README.md
+1
-1
test/unit.cpp
test/unit.cpp
+12
-0
No files found.
README.md
View file @
9e8e1133
...
@@ -379,7 +379,7 @@ $ make
...
@@ -379,7 +379,7 @@ $ make
$
./json_unit
$
./json_unit
===============================================================================
===============================================================================
All tests passed
(
4
280 assertions
in
16
test
cases
)
All tests passed
(
4
332 assertions
in
18
test
cases
)
```
```
For more information, have a look at the file
[
.travis.yml
](
https://github.com/nlohmann/json/blob/master/.travis.yml
)
.
For more information, have a look at the file
[
.travis.yml
](
https://github.com/nlohmann/json/blob/master/.travis.yml
)
.
test/unit.cpp
View file @
9e8e1133
...
@@ -2050,6 +2050,11 @@ TEST_CASE("value conversion")
...
@@ -2050,6 +2050,11 @@ TEST_CASE("value conversion")
//auto m4 = j4.get<std::unordered_multimap<std::string, std::string>>();
//auto m4 = j4.get<std::unordered_multimap<std::string, std::string>>();
//CHECK(m4["one"] == "eins");
//CHECK(m4["one"] == "eins");
}
}
SECTION
(
"exception in case of a non-object type"
)
{
CHECK_THROWS_AS
((
json
().
get
<
std
::
map
<
std
::
string
,
int
>>
()),
std
::
logic_error
);
}
}
}
SECTION
(
"array-like STL containers"
)
SECTION
(
"array-like STL containers"
)
...
@@ -2106,6 +2111,13 @@ TEST_CASE("value conversion")
...
@@ -2106,6 +2111,13 @@ TEST_CASE("value conversion")
auto
m3
=
j3
.
get
<
std
::
unordered_set
<
bool
>>
();
auto
m3
=
j3
.
get
<
std
::
unordered_set
<
bool
>>
();
auto
m4
=
j4
.
get
<
std
::
unordered_set
<
std
::
string
>>
();
auto
m4
=
j4
.
get
<
std
::
unordered_set
<
std
::
string
>>
();
}
}
SECTION
(
"exception in case of a non-object type"
)
{
CHECK_THROWS_AS
((
json
().
get
<
std
::
list
<
int
>>
()),
std
::
logic_error
);
CHECK_THROWS_AS
((
json
().
get
<
std
::
vector
<
int
>>
()),
std
::
logic_error
);
CHECK_THROWS_AS
((
json
().
get
<
std
::
vector
<
json
>>
()),
std
::
logic_error
);
}
}
}
}
}
}
}
...
...
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