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
33379684
Unverified
Commit
33379684
authored
Jan 17, 2021
by
Niels Lohmann
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
✅
improve coverage
parent
5ec09805
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
13 additions
and
6 deletions
+13
-6
diagnostics_t.hpp
include/nlohmann/detail/diagnostics_t.hpp
+3
-3
json.hpp
single_include/nlohmann/json.hpp
+3
-3
unit-diagnostics.cpp
test/src/unit-diagnostics.cpp
+7
-0
No files found.
include/nlohmann/detail/diagnostics_t.hpp
View file @
33379684
...
@@ -58,14 +58,14 @@ class diagnostics_t
...
@@ -58,14 +58,14 @@ class diagnostics_t
break
;
break
;
}
}
default
:
default
:
// LCOV_EXCL_LINE
break
;
break
;
// LCOV_EXCL_LINE
}
}
}
}
if
(
tokens
.
empty
())
if
(
tokens
.
empty
())
{
{
return
""
;
return
""
;
// LCOV_EXCL_LINE
}
}
return
"("
+
std
::
accumulate
(
tokens
.
rbegin
(),
tokens
.
rend
(),
std
::
string
{},
return
"("
+
std
::
accumulate
(
tokens
.
rbegin
(),
tokens
.
rend
(),
std
::
string
{},
...
...
single_include/nlohmann/json.hpp
View file @
33379684
...
@@ -2556,14 +2556,14 @@ class diagnostics_t
...
@@ -2556,14 +2556,14 @@ class diagnostics_t
break
;
break
;
}
}
default
:
default
:
// LCOV_EXCL_LINE
break
;
break
;
// LCOV_EXCL_LINE
}
}
}
}
if
(
tokens
.
empty
())
if
(
tokens
.
empty
())
{
{
return
""
;
return
""
;
// LCOV_EXCL_LINE
}
}
return
"("
+
std
::
accumulate
(
tokens
.
rbegin
(),
tokens
.
rend
(),
std
::
string
{},
return
"("
+
std
::
accumulate
(
tokens
.
rbegin
(),
tokens
.
rend
(),
std
::
string
{},
...
...
test/src/unit-diagnostics.cpp
View file @
33379684
...
@@ -40,6 +40,13 @@ using nlohmann::json;
...
@@ -40,6 +40,13 @@ using nlohmann::json;
TEST_CASE
(
"Better diagnostics"
)
TEST_CASE
(
"Better diagnostics"
)
{
{
SECTION
(
"empty JSON Pointer"
)
{
json
j
=
1
;
std
::
string
s
;
CHECK_THROWS_WITH_AS
(
s
=
j
.
get
<
std
::
string
>
(),
"[json.exception.type_error.302] type must be string, but is number"
,
json
::
type_error
);
}
SECTION
(
"invalid type"
)
SECTION
(
"invalid type"
)
{
{
json
j
;
json
j
;
...
...
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