From e3fc6ea2de77d51b200ad6ecb4c66ef8d6c7948b Mon Sep 17 00:00:00 2001 From: Arnau Siches Date: Fri, 12 Aug 2016 06:29:28 +0100 Subject: [PATCH] Add direction tests for foldl and foldr in list-ops --- exercises/list-ops/ListOpsTests.elm | 2 ++ 1 file changed, 2 insertions(+) diff --git a/exercises/list-ops/ListOpsTests.elm b/exercises/list-ops/ListOpsTests.elm index 2ddb4df..16ffb86 100644 --- a/exercises/list-ops/ListOpsTests.elm +++ b/exercises/list-ops/ListOpsTests.elm @@ -27,10 +27,12 @@ tests = , suite "foldl" [ test "empty list" (assertEqual 0 (foldl (+) 0 [])) , test "non-empty list" (assertEqual 10 (foldl (+) 0 [1..4])) + , test "direction" (assertEqual [4,3,2,1] (foldl (::) [] [1..4])) ] , suite "foldr" [ test "empty list" (assertEqual 0 (foldr (+) 0 [])) , test "non-empty list" (assertEqual 10 (foldr (+) 0 [1..4])) + , test "direction" (assertEqual [1..4] (foldr (::) [] [1..4])) ] , suite "append" [ test "empty lists" (assertEqual [] (append [] []))