mirror of
https://github.com/nlohmann/json.git
synced 2026-03-10 11:11:24 +00:00
Fix global UDLs (#3646)
* Add ci_test_noglobaludls to CI * Really default JSON_GLOBAL_UDLS to 1 * Test global UDLs * Suppress warnings * Clarify documentation
This commit is contained in:
committed by
GitHub
parent
817a4a2117
commit
cbaf1033be
@@ -8,8 +8,6 @@
|
||||
|
||||
#include "doctest_compatibility.h"
|
||||
|
||||
#undef JSON_USE_GLOBAL_UDLS
|
||||
#define JSON_USE_GLOBAL_UDLS 0
|
||||
#include <nlohmann/json.hpp>
|
||||
|
||||
TEST_CASE("user-defined string literals")
|
||||
@@ -48,4 +46,12 @@ TEST_CASE("user-defined string literals")
|
||||
CHECK(R"({"foo": "bar", "baz": 42})"_json == j_expected);
|
||||
CHECK("/foo/bar"_json_pointer == ptr_expected);
|
||||
}
|
||||
|
||||
#ifndef JSON_TEST_NO_GLOBAL_UDLS
|
||||
SECTION("global namespace")
|
||||
{
|
||||
CHECK(R"({"foo": "bar", "baz": 42})"_json == j_expected);
|
||||
CHECK("/foo/bar"_json_pointer == ptr_expected);
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user