@@ -11,6 +11,8 @@ class TTypeListTest: public TTestBase {
11
11
UNIT_TEST (TestGet);
12
12
UNIT_TEST (TestFloatList);
13
13
UNIT_TEST (TestSelectBy);
14
+ UNIT_TEST (TestUnique);
15
+ UNIT_TEST (TestUniqueTypeList);
14
16
UNIT_TEST_SUITE_END ();
15
17
16
18
public:
@@ -79,6 +81,19 @@ class TTypeListTest: public TTestBase {
79
81
UNIT_ASSERT_TYPES_EQUAL (TFixedWidthFloat<ui64>, double );
80
82
UNIT_ASSERT_TYPES_EQUAL (TFixedWidthFloat<i64 >, double );
81
83
}
84
+
85
+ void TestUnique () {
86
+ static_assert (std::is_same_v<NTL::TUnique<TSignedInts>::type, TSignedInts>);
87
+ static_assert (std::is_same_v<typename NTL::TUnique<typename NTL::TConcat<TSignedInts, TSignedInts>::type>::type, TSignedInts>);
88
+ }
89
+
90
+ void TestUniqueTypeList () {
91
+ static_assert (std::is_same_v<TUniqueTypeList<int >, TTypeList<int >>);
92
+ static_assert (std::is_same_v<TUniqueTypeList<int , int , int , int , int , int , int , int , int >, TTypeList<int >>);
93
+ static_assert (std::is_same_v<TUniqueTypeList<TSignedInts>, TTypeList<TSignedInts>>);
94
+ static_assert (std::is_same_v<TUniqueTypeList<TSignedInts, TSignedInts, TSignedInts, TSignedInts, TSignedInts, TSignedInts, TSignedInts, TSignedInts, TSignedInts>, TTypeList<TSignedInts>>);
95
+ static_assert (std::is_same_v<TUniqueTypeList<TSignedInts, TSignedInts, TSignedInts, TSignedInts, TSignedInts, TSignedInts, TSignedInts, TSignedInts, TSignedInts>, TUniqueTypeList<TSignedInts, TSignedInts, TSignedInts>>);
96
+ }
82
97
};
83
98
84
99
UNIT_TEST_SUITE_REGISTRATION (TTypeListTest);
0 commit comments