This commit is contained in:
2026-04-15 15:19:28 +08:00
commit 03229f23d4
159 changed files with 12538 additions and 0 deletions

18
tests/json_smoke_test.cpp Normal file
View File

@@ -0,0 +1,18 @@
#include "dps/json.hpp"
#include <cstdlib>
#include <iostream>
int main() {
const dps::Json value = dps::Json::parse("{\"hello\":\"world\",\"n\":1,\"list\":[true,false]}");
if (value["hello"].to_string_or("") != "world") {
std::cerr << "json parse failed\n";
return EXIT_FAILURE;
}
if (value["n"].to_int_or(0) != 1) {
std::cerr << "json number failed\n";
return EXIT_FAILURE;
}
std::cout << "json smoke test passed\n";
return EXIT_SUCCESS;
}