mirror of
https://codeberg.org/DawnMagnet/reflect-cpp
synced 2026-12-05 18:26:18 +08:00
Add error message for json read (#461)
This commit is contained in:
@@ -37,13 +37,13 @@ TEST(json, test_decode_error_without_exception) {
|
||||
R"({"firstName":"Homer";"lastName":"Simpson";"birthday":"1987-04-19"})";
|
||||
|
||||
rfl::Result<Person> result = rfl::error("result didn't get set");
|
||||
EXPECT_NO_THROW({
|
||||
result = rfl::json::read<Person>(faulty_string);
|
||||
});
|
||||
EXPECT_NO_THROW({ result = rfl::json::read<Person>(faulty_string); });
|
||||
|
||||
EXPECT_TRUE(!result.has_value() && true);
|
||||
|
||||
EXPECT_EQ(result.error().what(), "Could not parse document");
|
||||
EXPECT_EQ(result.error().what(),
|
||||
"Could not parse document: unexpected character, expected a comma "
|
||||
"or a closing brace");
|
||||
}
|
||||
|
||||
} // namespace test_error_messages
|
||||
|
||||
Reference in New Issue
Block a user