1c5f01b2fSopenharmony_ci//     __ _____ _____ _____
2c5f01b2fSopenharmony_ci//  __|  |   __|     |   | |  JSON for Modern C++ (supporting code)
3c5f01b2fSopenharmony_ci// |  |  |__   |  |  | | | |  version 3.11.2
4c5f01b2fSopenharmony_ci// |_____|_____|_____|_|___|  https://github.com/nlohmann/json
5c5f01b2fSopenharmony_ci//
6c5f01b2fSopenharmony_ci// SPDX-FileCopyrightText: 2013-2022 Niels Lohmann <https://nlohmann.me>
7c5f01b2fSopenharmony_ci// SPDX-License-Identifier: MIT
8c5f01b2fSopenharmony_ci
9c5f01b2fSopenharmony_ci#include "doctest_compatibility.h"
10c5f01b2fSopenharmony_ci
11c5f01b2fSopenharmony_ci#include <nlohmann/json.hpp>
12c5f01b2fSopenharmony_ciusing nlohmann::json;
13c5f01b2fSopenharmony_ci
14c5f01b2fSopenharmony_ciTEST_CASE("version information")
15c5f01b2fSopenharmony_ci{
16c5f01b2fSopenharmony_ci    SECTION("meta()")
17c5f01b2fSopenharmony_ci    {
18c5f01b2fSopenharmony_ci        json j = json::meta();
19c5f01b2fSopenharmony_ci
20c5f01b2fSopenharmony_ci        CHECK(j["name"] == "JSON for Modern C++");
21c5f01b2fSopenharmony_ci        CHECK(j["copyright"] == "(C) 2013-2022 Niels Lohmann");
22c5f01b2fSopenharmony_ci        CHECK(j["url"] == "https://github.com/nlohmann/json");
23c5f01b2fSopenharmony_ci        CHECK(j["version"] == json(
24c5f01b2fSopenharmony_ci        {
25c5f01b2fSopenharmony_ci            {"string", "3.11.2"},
26c5f01b2fSopenharmony_ci            {"major", 3},
27c5f01b2fSopenharmony_ci            {"minor", 11},
28c5f01b2fSopenharmony_ci            {"patch", 2}
29c5f01b2fSopenharmony_ci        }));
30c5f01b2fSopenharmony_ci
31c5f01b2fSopenharmony_ci        CHECK(j.find("platform") != j.end());
32c5f01b2fSopenharmony_ci        CHECK(j.at("compiler").find("family") != j.at("compiler").end());
33c5f01b2fSopenharmony_ci        CHECK(j.at("compiler").find("version") != j.at("compiler").end());
34c5f01b2fSopenharmony_ci        CHECK(j.at("compiler").find("c++") != j.at("compiler").end());
35c5f01b2fSopenharmony_ci    }
36c5f01b2fSopenharmony_ci}
37