mirror of
https://codeberg.org/DawnMagnet/reflect-cpp
synced 2026-11-27 21:36:19 +08:00
18 lines
380 B
C++
18 lines
380 B
C++
#include <chrono>
|
|
#include <rfl.hpp>
|
|
#include <rfl/json.hpp>
|
|
|
|
#include "write_and_read.hpp"
|
|
|
|
namespace test_duration {
|
|
|
|
struct TestStruct {
|
|
std::chrono::seconds duration;
|
|
};
|
|
|
|
TEST(json, test_duration) {
|
|
const auto test = TestStruct{.duration = std::chrono::seconds(10)};
|
|
write_and_read(test, R"({"duration":{"count":10,"unit":"seconds"}})");
|
|
}
|
|
} // namespace test_duration
|