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
c0427596
Commit
c0427596
authored
May 07, 2016
by
Niels
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
improved test coverage
parent
ea84a85b
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
11 additions
and
3 deletions
+11
-3
README.md
README.md
+1
-1
src/json.hpp
src/json.hpp
+2
-1
src/json.hpp.re2c
src/json.hpp.re2c
+2
-1
test/unit.cpp
test/unit.cpp
+6
-0
No files found.
README.md
View file @
c0427596
...
...
@@ -449,7 +449,7 @@ $ make
$
./json_unit
"*"
===============================================================================
All tests passed
(
5568
699
assertions
in
31
test
cases
)
All tests passed
(
5568
703
assertions
in
31
test
cases
)
```
For more information, have a look at the file
[
.travis.yml
](
https://github.com/nlohmann/json/blob/master/.travis.yml
)
.
src/json.hpp
View file @
c0427596
...
...
@@ -9708,7 +9708,8 @@ basic_json_parser_63:
default:
{
throw
std
::
domain_error
(
"unexpected parent type "
+
parent
.
type_name
());
// if there exists a parent it cannot be primitive
assert
(
false
);
// LCOV_EXCL_LINE
}
}
}
...
...
src/json.hpp.re2c
View file @
c0427596
...
...
@@ -9018,7 +9018,8 @@ class basic_json
default:
{
throw std::domain_error("unexpected parent type " + parent.type_name());
// if there exists a parent it cannot be primitive
assert(false); // LCOV_EXCL_LINE
}
}
}
...
...
test/unit.cpp
View file @
c0427596
...
...
@@ -12094,6 +12094,12 @@ TEST_CASE("JSON pointers")
CHECK_THROWS_AS
(
json
::
json_pointer
(
"/~"
),
std
::
domain_error
);
CHECK_THROWS_WITH
(
json
::
json_pointer
(
"/~"
),
"escape error: '~' must be followed with '0' or '1'"
);
json
::
json_pointer
p
;
CHECK_THROWS_AS
(
p
.
top
(),
std
::
domain_error
);
CHECK_THROWS_WITH
(
p
.
top
(),
"JSON pointer has no parent"
);
CHECK_THROWS_AS
(
p
.
pop_back
(),
std
::
domain_error
);
CHECK_THROWS_WITH
(
p
.
pop_back
(),
"JSON pointer has no parent"
);
}
SECTION
(
"examples from RFC 6901"
)
...
...
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