mirror of
https://github.com/nlohmann/json.git
synced 2026-11-02 19:05:35 +00:00
Tests: cover the remaining lines of the library headers
Add tests for the lines of include/nlohmann that were not covered: the binary readers and writers, the lexer and locale paths, the json_view modules, the custom number, key and array types, json_pointer, json_patch, diff and the iterators. Signed-off-by: Niels Lohmann <mail@nlohmann.me>
This commit is contained in:
33 files changed
+1627
-1
No files matched your search
@@ -819,6 +819,13 @@ TEST_CASE("json_view images: errors")
|
||||
static_cast<void>(d);
|
||||
}) == prefix + "too short");
|
||||
|
||||
// an image that is moved into the document is checked as well
|
||||
CHECK(exception_of([&]
|
||||
{
|
||||
const json_document d = json_document::load(std::vector<std::uint8_t>(10, 0));
|
||||
static_cast<void>(d);
|
||||
}) == prefix + "too short");
|
||||
|
||||
std::vector<std::uint8_t> bad = image;
|
||||
bad[0] = 'X';
|
||||
CHECK(load_result(bad, image_check::full) == prefix + "unknown format");
|
||||
|
||||
Reference in new issue
Block a user