Better error handling for YYJSON write (#413)

This commit is contained in:
Dr. Patrick Urbanke (劉自成)
2025-04-24 08:43:32 +08:00
committed by GitHub
parent 206d4f4d16
commit c36baf8d0b
2 changed files with 34 additions and 2 deletions
+19
View File
@@ -0,0 +1,19 @@
#include <iostream>
#include <rfl.hpp>
#include <rfl/json.hpp>
#include <string>
#include <vector>
#include "write_and_read.hpp"
namespace test_named_tuple {
TEST(json, test_named_tuple) {
const auto homer = rfl::make_field<"firstName", std::string>("Homer") *
rfl::make_field<"lastName", std::string>("Simpson") *
rfl::make_field<"age">(45);
write_and_read(homer,
R"({"firstName":"Homer","lastName":"Simpson","age":45})");
}
} // namespace test_named_tuple