Check the JSON Pointer roundtrip for every code point again

Sampling every 64th element of all_unicode.json gave up the claim that
every code point is tested for a small saving; the stringstream
removal keeps most of the speedup.

Signed-off-by: Niels Lohmann <mail@nlohmann.me>
This commit is contained in:
Niels Lohmann
2026-09-27 22:00:34 +02:00
parent 96cedfec81
commit 21c8935269
-8
View File
@@ -170,9 +170,6 @@ TEST_CASE("Unicode (1/5)" * doctest::skip())
SECTION("check JSON Pointers")
{
// escaping only treats '~' and '/' specially, so every 64th
// element plus those two characters suffices (#5418)
std::size_t index = 0;
for (const auto& s : j)
{
// skip non-string JSON values
@@ -183,11 +180,6 @@ TEST_CASE("Unicode (1/5)" * doctest::skip())
auto ptr = s.get<std::string>();
if (index++ % 64 != 0 && ptr != "~" && ptr != "/")
{
continue;
}
// tilde must be followed by 0 or 1
if (ptr == "~")
{