Merge pull request #1392 from mtalliance/feature/addFileInputAdapter

Feature/add file input adapter
This commit is contained in:
Niels Lohmann 2018-12-16 22:10:03 +01:00 committed by GitHub
commit 5d390e91ff
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 83 additions and 2 deletions

View file

@ -384,6 +384,41 @@ TEST_CASE("json.org examples")
json j;
CHECK_NOTHROW(f >> j);
}
SECTION("FILE 1.json")
{
std::unique_ptr<std::FILE, decltype(&std::fclose)> f(std::fopen("test/data/json.org/1.json", "r"), &std::fclose);
json j;
CHECK_NOTHROW(j.parse(f.get()));
}
SECTION("FILE 2.json")
{
std::unique_ptr<std::FILE, decltype(&std::fclose)> f(std::fopen("test/data/json.org/2.json", "r"), &std::fclose);
json j;
CHECK_NOTHROW(j.parse(f.get()));
}
SECTION("FILE 3.json")
{
std::unique_ptr<std::FILE, decltype(&std::fclose)> f(std::fopen("test/data/json.org/3.json", "r"), &std::fclose);
json j;
CHECK_NOTHROW(j.parse(f.get()));
}
SECTION("FILE 4.json")
{
std::unique_ptr<std::FILE, decltype(&std::fclose)> f(std::fopen("test/data/json.org/4.json", "r"), &std::fclose);
json j;
CHECK_NOTHROW(j.parse(f.get()));
}
SECTION("FILE 5.json")
{
std::unique_ptr<std::FILE, decltype(&std::fclose)> f(std::fopen("test/data/json.org/5.json", "r"), &std::fclose);
json j;
CHECK_NOTHROW(j.parse(f.get()));
}
}
TEST_CASE("RFC 7159 examples")