mirror of
https://codeberg.org/DawnMagnet/reflect-cpp
synced 2026-12-06 10:46:18 +08:00
This commit is contained in:
@@ -0,0 +1,21 @@
|
||||
#include <iostream>
|
||||
#include <rfl.hpp>
|
||||
#include <string>
|
||||
#include <vector>
|
||||
|
||||
#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
|
||||
Reference in New Issue
Block a user