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
7b98df51
Unverified
Commit
7b98df51
authored
Dec 29, 2020
by
Niels Lohmann
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
✅
add regression test
parent
98b21524
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
24 additions
and
0 deletions
+24
-0
.travis.yml
.travis.yml
+10
-0
test/src/unit-regression2.cpp
test/src/unit-regression2.cpp
+14
-0
No files found.
.travis.yml
View file @
7b98df51
...
...
@@ -300,6 +300,16 @@ matrix:
sources
:
[
'
ubuntu-toolchain-r-test'
,
'
llvm-toolchain-trusty-7'
]
packages
:
[
'
g++-7'
,
'
clang-7'
,
'
ninja-build'
]
-
os
:
linux
compiler
:
clang
env
:
-
COMPILER=clang++-7
-
CXX_STANDARD=20
addons
:
apt
:
sources
:
[
'
ubuntu-toolchain-r-test'
,
'
llvm-toolchain-trusty-7'
]
packages
:
[
'
g++-7'
,
'
clang-7'
,
'
ninja-build'
]
################
# build script #
################
...
...
test/src/unit-regression2.cpp
View file @
7b98df51
...
...
@@ -51,6 +51,10 @@ using nlohmann::json;
#include <variant>
#endif
#ifdef JSON_HAS_CPP_20
#include <span>
#endif
/////////////////////////////////////////////////////////////////////
// for #1021
/////////////////////////////////////////////////////////////////////
...
...
@@ -484,4 +488,14 @@ TEST_CASE("regression tests 2")
json
j
=
json
::
parse
(
ss
,
nullptr
,
true
,
true
);
CHECK
(
j
.
dump
()
==
"{}"
);
}
#ifdef JSON_HAS_CPP_20
SECTION
(
"issue #2546 - parsing containers of std::byte"
)
{
const
char
DATA
[]
=
R"("Hello, world!")"
;
const
auto
s
=
std
::
as_bytes
(
std
::
span
(
DATA
));
json
j
=
json
::
parse
(
s
);
CHECK
(
j
.
dump
==
"Hello, world!"
);
}
#endif
}
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