// __ _____ _____ _____// __| | __| | | | JSON for Modern C++ (supporting code)// | | |__ | | | | | | version 3.12.0// |_____|_____|_____|_|___| https://github.com/nlohmann/json//// SPDX-FileCopyrightText: 2013 - 2025 Niels Lohmann <https://nlohmann.me>// SPDX-License-Identifier: MIT#include "doctest_compatibility.h"#include <nlohmann/json.hpp>using nlohmann::json;TEST_CASE("version information"){SECTION("meta()"){json j = json::meta();CHECK(j["name"] == "JSON for Modern C++");CHECK(j["copyright"] == "(C) 2013-2025 Niels Lohmann");CHECK(j["url"] == "https://github.com/nlohmann/json");CHECK(j["version"] == json({{"string", "3.12.0"},{"major", 3},{"minor", 12},{"patch", 0}}));CHECK(j.find("platform") != j.end());CHECK(j.at("compiler").find("family") != j.at("compiler").end());CHECK(j.at("compiler").find("version") != j.at("compiler").end());CHECK(j.at("compiler").find("c++") != j.at("compiler").end());}}
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。