mirror of
https://codeberg.org/DawnMagnet/reflect-cpp
synced 2026-11-28 22:06:19 +08:00
20 lines
430 B
C++
20 lines
430 B
C++
#include <rfl.hpp>
|
|
#include <string>
|
|
|
|
#include "write_and_read.hpp"
|
|
|
|
namespace test_double {
|
|
|
|
TEST(yaml, test_double) {
|
|
auto obj = rfl::Generic::Object();
|
|
const double age = 10;
|
|
obj["age"] = age;
|
|
const auto s = rfl::yaml::write(obj);
|
|
EXPECT_EQ(
|
|
rfl::from_generic<double>(
|
|
rfl::yaml::read<rfl::Generic::Object>(s).value().get("age").value())
|
|
.value(),
|
|
10.0);
|
|
}
|
|
} // namespace test_double
|