mirror of
https://github.com/nlohmann/json.git
synced 2025-07-22 15:21:52 +03:00
🐛 parsing erroneous files yields an exception (#366)
This commit is contained in:
@ -495,4 +495,10 @@ TEST_CASE("regression tests")
|
||||
json j = json::parse("22e2222");
|
||||
CHECK(j == json());
|
||||
}
|
||||
|
||||
SECTION("issue #366 - json::parse on failed stream gets stuck")
|
||||
{
|
||||
std::ifstream f("file_not_found.json");
|
||||
CHECK_THROWS_AS(json::parse(f), std::invalid_argument);
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user