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
bb142d6c
Commit
bb142d6c
authored
May 09, 2015
by
Niels
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
added test cases
parent
869035a6
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
unit.cpp
test/unit.cpp
+11
-0
No files found.
README.md
View file @
bb142d6c
...
@@ -396,7 +396,7 @@ $ make
...
@@ -396,7 +396,7 @@ $ make
$
./json_unit
$
./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
)
.
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")
...
@@ -7377,6 +7377,15 @@ TEST_CASE("parser class")
// empty string
// empty string
CHECK
(
json
::
parser
(
"
\"\"
"
).
parse
()
==
json
(
json
::
value_t
::
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"
)
SECTION
(
"escaped"
)
{
{
// quotation mark "\""
// quotation mark "\""
...
@@ -8524,11 +8533,13 @@ TEST_CASE("regression tests")
...
@@ -8524,11 +8533,13 @@ TEST_CASE("regression tests")
SECTION
(
"NAN value"
)
SECTION
(
"NAN value"
)
{
{
CHECK
(
json
(
NAN
)
==
json
());
CHECK
(
json
(
NAN
)
==
json
());
CHECK
(
json
(
json
::
number_float_t
(
NAN
))
==
json
());
}
}
SECTION
(
"infinity"
)
SECTION
(
"infinity"
)
{
{
CHECK
(
json
(
INFINITY
)
==
json
());
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