From 7e2d1599378814a0eb0e5db8db57b379d284438b Mon Sep 17 00:00:00 2001 From: Stanislaw Halik Date: Sat, 19 Nov 2022 15:20:28 +0100 Subject: entity: add test for only some constraints passed --- test/entity.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'test') 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{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::field{ + "foo"_s, &TestAccessors::foo, &TestAccessors::foo, + constantly(constraints::length{123}), + }; + static_assert(foo2.get_range(x) == std::pair{limits::min(), limits::max()}); + static_assert(foo2.get_max_length(x) == 123); + static_assert(foo2.get_group(x) == ""_s); } } // namespace -- cgit v1.2.3