Add Exceptions indicating which line contains error when parsing JSON

This commit is contained in:
Vyn 2024-11-29 10:50:49 +01:00
parent fd034eff71
commit 2639dba60a
9 changed files with 307 additions and 177 deletions

View file

@ -25,7 +25,7 @@ TEST_CASE("Parsing json object") {
"keyString": "YEP"
})";
auto json = rei::json::parse(jsonStr);
auto& objectJson = std::get<rei::json::JsonObject>(json);
auto& objectJson = json.asObject();
REQUIRE(objectJson.getNumber("keyPositiveNumber") == 12);
REQUIRE(objectJson.getNumber("keyNegativeNumber") == -13);