9 #include <boost/test/unit_test.hpp>
23 #include <boost/hana/equal.hpp>
24 #include <boost/hana/integral_constant.hpp>
25 #include <boost/hana/tuple.hpp>
26 #include <boost/hana/type.hpp>
28 namespace hana = boost::hana;
29 using namespace hana::literals;
31 #define _T(...) hana::tuple_c<size_t, __VA_ARGS__>
38 constexpr
auto result = detail::unique_ordered_sublists<1>();
39 constexpr
auto expected = hana::make_tuple(
_T(0));
40 static_assert(result == expected,
"At size 1 is not equal");
43 constexpr
auto result = detail::unique_ordered_sublists<2>();
44 constexpr
auto expected = hana::make_tuple(
_T(0),
_T(1),
_T(0, 1));
45 static_assert(result == expected,
"At size 2 is not equal");
48 constexpr
auto result = detail::unique_ordered_sublists<3>();
49 constexpr
auto expected = hana::make_tuple(
_T(0),
_T(1),
_T(0, 1),
_T(2),
50 _T(0, 2),
_T(1, 2),
_T(0, 1, 2));
51 static_assert(result == expected,
"At size 3 is not equal");
54 constexpr
auto result = detail::unique_ordered_sublists<4>();
55 constexpr
auto expected =
56 hana::make_tuple(
_T(0),
_T(1),
_T(0, 1),
_T(2),
_T(0, 2),
_T(1, 2),
57 _T(0, 1, 2),
_T(3),
_T(0, 3),
_T(1, 3),
_T(0, 1, 3),
58 _T(2, 3),
_T(0, 2, 3),
_T(1, 2, 3),
_T(0, 1, 2, 3));
59 static_assert(result == expected,
"At size 4 is not equal");
62 constexpr
auto result = detail::unique_ordered_sublists<5>();
63 constexpr
auto expected = hana::make_tuple(
64 _T(0),
_T(1),
_T(0, 1),
_T(2),
_T(0, 2),
_T(1, 2),
_T(0, 1, 2),
_T(3),
65 _T(0, 3),
_T(1, 3),
_T(0, 1, 3),
_T(2, 3),
_T(0, 2, 3),
_T(1, 2, 3),
66 _T(0, 1, 2, 3),
_T(4),
_T(0, 4),
_T(1, 4),
_T(0, 1, 4),
_T(2, 4),
67 _T(0, 2, 4),
_T(1, 2, 4),
_T(0, 1, 2, 4),
_T(3, 4),
_T(0, 3, 4),
68 _T(1, 3, 4),
_T(0, 1, 3, 4),
_T(2, 3, 4),
_T(0, 2, 3, 4),
69 _T(1, 2, 3, 4),
_T(0, 1, 2, 3, 4));
70 static_assert(result == expected,
"At size 5 is not equal");
77 template <
par_t... pars>
82 constexpr
par_t operator"" _p(
unsigned long long i) {
88 using actual = detail::type_generator_t<meas_factory, 1>;
89 using expected = std::variant<Measurement<SourceLink, 0_p>>;
91 "Variant is not identical");
94 using actual = detail::type_generator_t<meas_factory, 2>;
99 "Variant is not identical");
102 using actual = detail::type_generator_t<meas_factory, 3>;
103 using expected = std::variant<
109 "Variant is not identical");
112 using actual = detail::type_generator_t<meas_factory, 4>;
113 using expected = std::variant<
125 "Variant is not identical");
128 using actual = detail::type_generator_t<meas_factory, 5>;
129 using expected = std::variant<
156 "Variant is not identical");