mirror of
https://github.com/correl/elm.git
synced 2024-12-18 11:06:17 +00:00
Add direction tests for foldl and foldr in list-ops
This commit is contained in:
parent
8710ff3d3c
commit
e3fc6ea2de
1 changed files with 2 additions and 0 deletions
|
@ -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 [] []))
|
||||
|
|
Loading…
Reference in a new issue