✅ add regression test
This commit is contained in:
parent
98b2152452
commit
7b98df515f
10
.travis.yml
10
.travis.yml
@ -300,6 +300,16 @@ matrix:
|
|||||||
sources: ['ubuntu-toolchain-r-test', 'llvm-toolchain-trusty-7']
|
sources: ['ubuntu-toolchain-r-test', 'llvm-toolchain-trusty-7']
|
||||||
packages: ['g++-7', 'clang-7', 'ninja-build']
|
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 #
|
# build script #
|
||||||
################
|
################
|
||||||
|
@ -51,6 +51,10 @@ using nlohmann::json;
|
|||||||
#include <variant>
|
#include <variant>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#ifdef JSON_HAS_CPP_20
|
||||||
|
#include <span>
|
||||||
|
#endif
|
||||||
|
|
||||||
/////////////////////////////////////////////////////////////////////
|
/////////////////////////////////////////////////////////////////////
|
||||||
// for #1021
|
// for #1021
|
||||||
/////////////////////////////////////////////////////////////////////
|
/////////////////////////////////////////////////////////////////////
|
||||||
@ -484,4 +488,14 @@ TEST_CASE("regression tests 2")
|
|||||||
json j = json::parse(ss, nullptr, true, true);
|
json j = json::parse(ss, nullptr, true, true);
|
||||||
CHECK(j.dump() == "{}");
|
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
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user