From 42b37a718fcd3e133f3a74e9345879b91bf71bf8 Mon Sep 17 00:00:00 2001 From: Patrick Pelissier Date: Sun, 15 Jul 2018 22:26:21 +0200 Subject: [PATCH] Add test. --- tests/test-malgo.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/tests/test-malgo.c b/tests/test-malgo.c index 41e43add..aadbb41a 100644 --- a/tests/test-malgo.c +++ b/tests/test-malgo.c @@ -162,6 +162,16 @@ static void test_array(void) assert( algo_array_contain_p(l, -1) == false); assert( algo_array_sort_p(l) == true); + assert (algo_array_all_of_p(l, func_test_42) == false); + assert (algo_array_any_of_p(l, func_test_42) == true); + assert (algo_array_none_of_p(l, func_test_42) == false); + assert (algo_array_all_of_p(l, func_test_101) == false); + assert (algo_array_any_of_p(l, func_test_101) == false); + assert (algo_array_none_of_p(l, func_test_101) == true); + assert (algo_array_all_of_p(l, func_test_pos) == true); + assert (algo_array_any_of_p(l, func_test_pos) == true); + assert (algo_array_none_of_p(l, func_test_pos) == false); + assert( algo_array_count(l, 1) == 1); array_int_push_back (l, 17); assert( algo_array_count(l, 17) == 2);