diff options
Diffstat (limited to 'test.cc')
-rw-r--r-- | test.cc | 30 |
1 files changed, 30 insertions, 0 deletions
@@ -9,6 +9,7 @@ #include "list/operation/contains.h" #include "list/operation/higher/map.h" #include "list/operation/higher/filter.h" +#include "list/operation/higher/partition.h" #include "list/operation/higher/query.h" #include "list/generator/iota.h" #include "list/generator/make_list.h" @@ -427,6 +428,35 @@ static_assert( "(filter odd? (list 1 2 3)) != (list 1 3)" ); +// list remove + +static_assert( + std::is_same< + tav::List<tav::Int<1>, tav::Int<3>>::type, + tav::Remove< + tav::Even, + tav::List<tav::Int<1>, tav::Int<2>, tav::Int<3>>::type + >::type + >::value, + "(remove even? (list 1 2 3)) != (list 1 3)" +); + +// list partition + +static_assert( + std::is_same< + tav::Cons< + tav::List<tav::Int<1>, tav::Int<3>>::type, + tav::List<tav::Int<2>>::type + >, + tav::Partition< + tav::Odd, + tav::List<tav::Int<1>, tav::Int<2>, tav::Int<3>>::type + >::type + >::value, + "(partition odd? (list 1 2 3)) != [(list 1 3) (list 2)]" +); + // list reverse static_assert( |