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
e3460118
Commit
e3460118
authored
Feb 13, 2015
by
Niels
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
more test cases for numbers
parent
c864ea21
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
0 deletions
+8
-0
test/unit.cpp
test/unit.cpp
+8
-0
No files found.
test/unit.cpp
View file @
e3460118
...
...
@@ -5133,6 +5133,9 @@ TEST_CASE("parser class")
CHECK
(
json
::
parser
(
"10000e2"
).
parse
()
==
json
(
10000e2
));
CHECK
(
json
::
parser
(
"10000e3"
).
parse
()
==
json
(
10000e3
));
CHECK
(
json
::
parser
(
"10000e4"
).
parse
()
==
json
(
10000e4
));
CHECK
(
json
::
parser
(
"-0e1"
).
parse
()
==
json
(
-
0e1
));
CHECK
(
json
::
parser
(
"-0E1"
).
parse
()
==
json
(
-
0e1
));
}
}
...
...
@@ -5143,12 +5146,15 @@ TEST_CASE("parser class")
CHECK
(
json
::
parser
(
"-128.5"
).
parse
()
==
json
(
-
128.5
));
CHECK
(
json
::
parser
(
"0.999"
).
parse
()
==
json
(
0.999
));
CHECK
(
json
::
parser
(
"128.5"
).
parse
()
==
json
(
128.5
));
CHECK
(
json
::
parser
(
"-0.0"
).
parse
()
==
json
(
-
0.0
));
}
SECTION
(
"with exponent"
)
{
CHECK
(
json
::
parser
(
"-128.5E3"
).
parse
()
==
json
(
-
128.5E3
));
CHECK
(
json
::
parser
(
"-128.5E-3"
).
parse
()
==
json
(
-
128.5E-3
));
CHECK
(
json
::
parser
(
"-0.0e1"
).
parse
()
==
json
(
-
0.0e1
));
CHECK
(
json
::
parser
(
"-0.0E1"
).
parse
()
==
json
(
-
0.0e1
));
}
}
...
...
@@ -5161,6 +5167,8 @@ TEST_CASE("parser class")
CHECK_THROWS_AS
(
json
::
parser
(
"1E-"
).
parse
(),
std
::
invalid_argument
);
CHECK_THROWS_AS
(
json
::
parser
(
"1.E1"
).
parse
(),
std
::
invalid_argument
);
CHECK_THROWS_AS
(
json
::
parser
(
"-1E"
).
parse
(),
std
::
invalid_argument
);
CHECK_THROWS_AS
(
json
::
parser
(
"-0E#"
).
parse
(),
std
::
invalid_argument
);
CHECK_THROWS_AS
(
json
::
parser
(
"-0E-#"
).
parse
(),
std
::
invalid_argument
);
}
}
}
...
...
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