diff --git a/tests/json/test_meta_fields.cpp b/tests/json/test_meta_fields.cpp index 90d17313..1d759a89 100644 --- a/tests/json/test_meta_fields.cpp +++ b/tests/json/test_meta_fields.cpp @@ -27,7 +27,7 @@ void test() { // The exact content is somewhat unpredictable, we just want to make sure it // compiles. if (fields.size() == 5) { - std::cout << "OK" << std::endl; + std::cout << "OK" << std::endl << std::endl; } } } // namespace test_meta_fields diff --git a/tests/json/test_view.cpp b/tests/json/test_view.cpp index b09622c7..e1de18de 100644 --- a/tests/json/test_view.cpp +++ b/tests/json/test_view.cpp @@ -31,23 +31,5 @@ void test() { write_and_read(lisa, R"({"first_name":"Maggie","last_name":"Simpson","age":0})"); - - view.apply([](const Field& field) { - using field_type = std::remove_pointer_t; - if constexpr (Field::name() == "age") { - static_assert(std::is_same_v); - } else { - static_assert(std::is_same_v); - } - }); - - rfl::to_view(lisa).apply([](auto field) { - if constexpr (decltype(field)::name() == "first_name") { - *field.value() = "Bart"; - } - }); - - write_and_read(lisa, - R"({"first_name":"Bart","last_name":"Simpson","age":0})"); } } // namespace test_view diff --git a/tests/json/tests.cpp b/tests/json/tests.cpp index aef770dd..9b51e510 100644 --- a/tests/json/tests.cpp +++ b/tests/json/tests.cpp @@ -3,6 +3,7 @@ #include "test_alphanumeric_unordered_map.hpp" #include "test_anonymous_fields.hpp" #include "test_any_of.hpp" +#include "test_apply.hpp" #include "test_array.hpp" #include "test_as.hpp" #include "test_as2.hpp" @@ -139,6 +140,7 @@ int main() { test_as2::test(); test_as_flatten::test(); test_view::test(); + test_apply::test(); test_custom_constructor::test();