aboutsummaryrefslogtreecommitdiff
path: root/test.cc
diff options
context:
space:
mode:
Diffstat (limited to 'test.cc')
-rw-r--r--test.cc39
1 files changed, 39 insertions, 0 deletions
diff --git a/test.cc b/test.cc
index b945899..173aa19 100644
--- a/test.cc
+++ b/test.cc
@@ -5,6 +5,7 @@
#include "list/cons.h"
#include "list/list.h"
+#include "list/iota.h"
#include "list/operation/reverse.h"
#include "list/operation/contains.h"
#include "list/operation/higher/fold.h"
@@ -507,3 +508,41 @@ static_assert(
>::value,
"(length (concatenate (list (list 1 2) (list 3) (list 4 5 6)))) != 6"
);
+
+// list iota
+
+static_assert(
+ std::is_same<
+ tav::List<tav::Int<1>, tav::Int<2>, tav::Int<3>>::type,
+ tav::Iota<
+ tav::Size<3>,
+ tav::Int<1>,
+ tav::Int<1>
+ >::type
+ >::value,
+ "(iota 3 1 1) != (list 1 2 3)"
+);
+
+static_assert(
+ std::is_same<
+ tav::List<tav::Int<0>, tav::Int<2>, tav::Int<4>, tav::Int<6>, tav::Int<8>>::type,
+ tav::Iota<
+ tav::Size<5>,
+ tav::Int<0>,
+ tav::Int<2>
+ >::type
+ >::value,
+ "(iota 5 0 2) != (list 0 2 4 6 8)"
+);
+
+static_assert(
+ std::is_same<
+ tav::List<tav::Int<5>, tav::Int<4>, tav::Int<3>, tav::Int<2>, tav::Int<1>>::type,
+ tav::Iota<
+ tav::Size<5>,
+ tav::Int<5>,
+ tav::Int<-1>
+ >::type
+ >::value,
+ "(iota 5 5 -1) != (list 5 4 3 2 1)"
+);