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
bb142d6c
Commit
bb142d6c
authored
May 09, 2015
by
Niels
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
added test cases
parent
869035a6
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
12 additions
and
1 deletion
+12
-1
README.md
README.md
+1
-1
test/unit.cpp
test/unit.cpp
+11
-0
No files found.
README.md
View file @
bb142d6c
...
...
@@ -396,7 +396,7 @@ $ make
$
./json_unit
===============================================================================
All tests passed
(
4
673 assertions
in
19
test
cases
)
All tests passed
(
4
707 assertions
in
20
test
cases
)
```
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 @
bb142d6c
...
...
@@ -7377,6 +7377,15 @@ TEST_CASE("parser class")
// empty string
CHECK
(
json
::
parser
(
"
\"\"
"
).
parse
()
==
json
(
json
::
value_t
::
string
));
SECTION
(
"errors"
)
{
// error: tab in string
CHECK_THROWS_AS
(
json
::
parser
(
"
\"\t\"
"
).
parse
(),
std
::
invalid_argument
);
// error: newline in string
CHECK_THROWS_AS
(
json
::
parser
(
"
\"\n\"
"
).
parse
(),
std
::
invalid_argument
);
CHECK_THROWS_AS
(
json
::
parser
(
"
\"\r\"
"
).
parse
(),
std
::
invalid_argument
);
}
SECTION
(
"escaped"
)
{
// quotation mark "\""
...
...
@@ -8524,11 +8533,13 @@ TEST_CASE("regression tests")
SECTION
(
"NAN value"
)
{
CHECK
(
json
(
NAN
)
==
json
());
CHECK
(
json
(
json
::
number_float_t
(
NAN
))
==
json
());
}
SECTION
(
"infinity"
)
{
CHECK
(
json
(
INFINITY
)
==
json
());
CHECK
(
json
(
json
::
number_float_t
(
INFINITY
))
==
json
());
}
}
}
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