summaryrefslogtreecommitdiffhomepage
path: root/test
diff options
context:
space:
mode:
authorStanislaw Halik <sthalik@misaki.pl>2022-11-19 15:20:28 +0100
committerStanislaw Halik <sthalik@misaki.pl>2022-11-19 15:20:32 +0100
commit7e2d1599378814a0eb0e5db8db57b379d284438b (patch)
tree263376a7210bd6b320fa1924baff1d06b8c3f456 /test
parent67760d797c7dac09077e59a87fa3c27a610a5fc4 (diff)
entity: add test for only some constraints passed
Diffstat (limited to 'test')
-rw-r--r--test/entity.cpp8
1 files changed, 8 insertions, 0 deletions
diff --git a/test/entity.cpp b/test/entity.cpp
index 4e0935f2..34b89d1f 100644
--- a/test/entity.cpp
+++ b/test/entity.cpp
@@ -205,6 +205,14 @@ constexpr void test_range()
static_assert(m_foo.get_range(x) == std::pair<int, int>{limits::min(), limits::max()});
static_assert(m_foo.get_max_length(x) == (std::size_t)-1);
static_assert(m_foo.get_group(x) == ""_s);
+
+ constexpr auto foo2 = entity::type<int>::field{
+ "foo"_s, &TestAccessors::foo, &TestAccessors::foo,
+ constantly<TestAccessors>(constraints::length{123}),
+ };
+ static_assert(foo2.get_range(x) == std::pair<int, int>{limits::min(), limits::max()});
+ static_assert(foo2.get_max_length(x) == 123);
+ static_assert(foo2.get_group(x) == ""_s);
}
} // namespace