add test

This commit is contained in:
Niels Lohmann 2024-11-21 13:55:06 +01:00
parent 42d7193db2
commit 8794ba17c2
No known key found for this signature in database
GPG Key ID: 486AF250E8FA0591

View File

@ -19,60 +19,64 @@ struct ParserImpl final: public nlohmann::json_sax<json>
bool null() override
{
return true;
};
}
bool boolean(bool /*val*/) override
{
return true;
};
}
bool number_integer(json::number_integer_t /*val*/) override
{
return true;
};
}
bool number_unsigned(json::number_unsigned_t /*val*/) override
{
return true;
};
}
bool number_float(json::number_float_t /*val*/, const json::string_t& s) override
{
float_string_copy = s;
return true;
};
}
bool string(json::string_t& /*val*/) override
{
return true;
};
}
bool binary(json::binary_t& /*val*/) override
{
return true;
};
}
bool start_object(std::size_t /*val*/) override
{
return true;
};
}
bool key(json::string_t& /*val*/) override
{
return true;
};
}
bool end_object() override
{
return true;
};
}
bool start_array(std::size_t /*val*/) override
{
return true;
};
}
bool end_array() override
{
return true;
};
}
bool parse_error(std::size_t /*val*/, const std::string& /*val*/, const nlohmann::detail::exception& /*val*/) override
{
return false;
};
}
~ParserImpl() override;
json::string_t float_string_copy;
};
ParserImpl::~ParserImpl() = default;
TEST_CASE("locale-dependent test (LC_NUMERIC=C")
{
if (std::setlocale(LC_NUMERIC, "C") == nullptr)