aboutsummaryrefslogtreecommitdiff
path: root/test.cc
diff options
context:
space:
mode:
Diffstat (limited to 'test.cc')
-rw-r--r--test.cc31
1 files changed, 31 insertions, 0 deletions
diff --git a/test.cc b/test.cc
index 368cce5..1a20a74 100644
--- a/test.cc
+++ b/test.cc
@@ -11,6 +11,7 @@
#include "list/operation/higher/misc.h"
#include "list/operation/higher/query.h"
#include "list/generator/iota.h"
+#include "list/generator/make_list.h"
#include "list/generator/higher/list_tabulate.h"
int main(int, char **) { }
@@ -514,6 +515,18 @@ static_assert(
static_assert(
std::is_same<
+ tav::List<tav::Int<1>>::type,
+ tav::Iota<
+ tav::Size<1>,
+ tav::Int<1>,
+ tav::Int<1>
+ >::type
+ >::value,
+ "(iota 1 1 1) != (list 1)"
+);
+
+static_assert(
+ std::is_same<
tav::List<tav::Int<1>, tav::Int<2>, tav::Int<3>>::type,
tav::Iota<
tav::Size<3>,
@@ -548,6 +561,24 @@ static_assert(
"(iota 5 5 -1) != (list 5 4 3 2 1)"
);
+// make list
+
+static_assert(
+ std::is_same<
+ tav::List<tav::Int<42>>::type,
+ tav::MakeList<tav::Size<1>, tav::Int<42>>::type
+ >::value,
+ "(make-list 1 42) != (list 42)"
+);
+
+static_assert(
+ std::is_same<
+ tav::List<tav::Int<42>, tav::Int<42>, tav::Int<42>>::type,
+ tav::MakeList<tav::Size<3>, tav::Int<42>>::type
+ >::value,
+ "(make-list 3 42) != (list 42 42 42)"
+);
+
// list tabulate
static_assert(