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
8d88a1da
Commit
8d88a1da
authored
Feb 05, 2017
by
Niels Lohmann
Browse files
Options
Browse Files
Download
Plain Diff
🔀
merged #379 and fixed conflicts
parents
d284c86d
c236b596
Changes
3
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
471 additions
and
271 deletions
+471
-271
src/json.hpp
src/json.hpp
+222
-135
src/json.hpp.re2c
src/json.hpp.re2c
+222
-135
test/src/unit-regression.cpp
test/src/unit-regression.cpp
+27
-1
No files found.
src/json.hpp
View file @
8d88a1da
This diff is collapsed.
Click to expand it.
src/json.hpp.re2c
View file @
8d88a1da
This diff is collapsed.
Click to expand it.
test/src/unit-regression.cpp
View file @
8d88a1da
...
...
@@ -383,7 +383,7 @@ TEST_CASE("regression tests")
};
// change locale to mess with decimal points
std
::
locale
::
global
(
std
::
locale
(
std
::
locale
(),
new
CommaDecimalSeparator
));
auto
orig_locale
=
std
::
locale
::
global
(
std
::
locale
(
std
::
locale
(),
new
CommaDecimalSeparator
));
CHECK
(
j1a
.
dump
()
==
"23.42"
);
CHECK
(
j1b
.
dump
()
==
"23.42"
);
...
...
@@ -407,8 +407,34 @@ TEST_CASE("regression tests")
CHECK
(
j3c
.
dump
()
==
"10000"
);
//CHECK(j3b.dump() == "1E04"); // roundtrip error
//CHECK(j3c.dump() == "1e04"); // roundtrip error
std
::
locale
::
global
(
orig_locale
);
}
SECTION
(
"issue #379 - locale-independent str-to-num"
)
{
setlocale
(
LC_NUMERIC
,
"de_DE.UTF-8"
);
// disabled, because locale-specific beharivor is not
// triggered in AppVeyor for some reason
#if 0
{
// verify that strtod now uses commas as decimal-separator
CHECK(std::strtod("3,14", nullptr) == 3.14);
// verify that strtod does not understand dots as decimal separator
CHECK(std::strtod("3.14", nullptr) == 3);
}
#endif
// verify that parsed correctly despite using strtod internally
CHECK
(
json
::
parse
(
"3.14"
).
get
<
double
>
()
==
3.14
);
// check a different code path
CHECK
(
json
::
parse
(
"1.000000000000000000000000000000000000000000000000000000000000000000000000"
).
get
<
double
>
()
==
1.0
);
}
SECTION
(
"issue #233 - Can't use basic_json::iterator as a base iterator for std::move_iterator"
)
{
json
source
=
{
"a"
,
"b"
,
"c"
};
...
...
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