From d300856292e2ca5c381805c5ae35fb6e22db6cd5 Mon Sep 17 00:00:00 2001 From: Niels Lohmann Date: Thu, 21 Oct 2021 07:43:52 +0200 Subject: [PATCH] :white_check_mark: add test --- test/CMakeLists.txt | 4 ++++ test/src/unit-regression2.cpp | 2 ++ 2 files changed, 6 insertions(+) diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt index 0ab021051..ab598878b 100644 --- a/test/CMakeLists.txt +++ b/test/CMakeLists.txt @@ -62,6 +62,10 @@ endforeach() if ("${CMAKE_CXX_COMPILER_ID}" MATCHES "Clang" AND CMAKE_CXX_COMPILER_VERSION VERSION_LESS 5.0) unset(compiler_supports_cpp_17) endif() +# MSVC 2015 (14.0) does not support C++17 +if ("${CMAKE_CXX_COMPILER_ID}" MATCHES "MSVC" AND CMAKE_CXX_COMPILER_VERSION VERSION_LESS 19.1) + unset(compiler_supports_cpp_17) +endif() file(GLOB files src/unit-*.cpp) diff --git a/test/src/unit-regression2.cpp b/test/src/unit-regression2.cpp index 22c0154d3..0d625f038 100644 --- a/test/src/unit-regression2.cpp +++ b/test/src/unit-regression2.cpp @@ -776,6 +776,8 @@ TEST_CASE("regression tests 2") const auto j_path = j.get(); CHECK(j_path == text_path); + + CHECK_THROWS_WITH_AS(nlohmann::detail::std_fs::path(json(1)), "[json.exception.type_error.302] type must be string, but is number", json::type_error); } #endif