aboutsummaryrefslogtreecommitdiff
path: root/test.cc
diff options
context:
space:
mode:
authorAdrian Kummerlaender2015-02-01 13:12:02 +0100
committerAdrian Kummerlaender2015-02-01 13:12:02 +0100
commit70429313c8d917255c35dabe14f64209dd6463db (patch)
treea6a26da84188a7ded7108ce4aa04015712493cb1 /test.cc
parent858a079c338ff2607994a3b97c87c57fbac7ec6e (diff)
downloadTypeAsValue-70429313c8d917255c35dabe14f64209dd6463db.tar
TypeAsValue-70429313c8d917255c35dabe14f64209dd6463db.tar.gz
TypeAsValue-70429313c8d917255c35dabe14f64209dd6463db.tar.bz2
TypeAsValue-70429313c8d917255c35dabe14f64209dd6463db.tar.lz
TypeAsValue-70429313c8d917255c35dabe14f64209dd6463db.tar.xz
TypeAsValue-70429313c8d917255c35dabe14f64209dd6463db.tar.zst
TypeAsValue-70429313c8d917255c35dabe14f64209dd6463db.zip
Added `DropWhile` analogously to `TakeWhile`
Diffstat (limited to 'test.cc')
-rw-r--r--test.cc36
1 files changed, 36 insertions, 0 deletions
diff --git a/test.cc b/test.cc
index 6accc0e..9351afd 100644
--- a/test.cc
+++ b/test.cc
@@ -13,6 +13,7 @@
#include "list/operation/higher/query.h"
#include "list/operation/higher/find.h"
#include "list/operation/higher/take_while.h"
+#include "list/operation/higher/drop_while.h"
#include "list/generator/iota.h"
#include "list/generator/make_list.h"
#include "list/generator/higher/list_tabulate.h"
@@ -754,6 +755,41 @@ static_assert(
"(take-while odd? (list 2 4 5 6)) != void"
);
+// list drop while
+
+static_assert(
+ std::is_same<
+ tav::List<tav::Int<5>, tav::Int<6>>::type,
+ tav::DropWhile<
+ tav::Even,
+ tav::List<tav::Int<2>, tav::Int<4>, tav::Int<5>, tav::Int<6>>::type
+ >::type
+ >::value,
+ "(drop-while even? (list 2 4 5 6)) != (list 5 6)"
+);
+
+static_assert(
+ std::is_same<
+ tav::List<tav::Int<2>, tav::Int<4>, tav::Int<6>>::type,
+ tav::DropWhile<
+ tav::Odd,
+ tav::List<tav::Int<2>, tav::Int<4>, tav::Int<6>>::type
+ >::type
+ >::value,
+ "(drop-while odd? (list 2 4 6)) != (list 2 4 6)"
+);
+
+static_assert(
+ std::is_same<
+ void,
+ tav::DropWhile<
+ tav::Even,
+ tav::List<tav::Int<2>, tav::Int<4>, tav::Int<6>>::type
+ >::type
+ >::value,
+ "(drop-while even? (list 2 4 6)) != void"
+);
+
// function apply
static_assert(