Add some tests for new function

This commit is contained in:
Patrick Pelissier committed 2021-02-05 00:17:18 +01:00
1 parent 0de771036b
commit ad39cdd393
1 file changed
+12
+12
View File
@@ -402,6 +402,18 @@ static void test_reduce(void)
assert ( M_REDUCE(M_ID, add, M_SEQ(1, 5))
+ M_REDUCE(M_ID, add, M_SEQ(6, 10))
== M_REDUCE(M_ID, add, M_SEQ(1, 10)));
#define add3(a,b,c) (a + b + c)
#define mul(a,b) (a) * (b)
int d = 42;
assert ( M_REDUCE3(add3, mul, d, 20, 4, 5) ==
(d + 1 + 20) * (
(d + 2 + 4) * (
(d + 3 + 5)
)
)
);
}
static void test_as_type(void)