1module Test.List (tests) where
5import ElmTest.Assertion (..)
6import ElmTest.Test (..)
13 isEven n = n `mod` 2 == 0
14 in suite "partition Tests" [ test "simple partition" <| assertEqual ([True],[False]) (List.partition p1 [False, True]),
15 test "order check" <| assertEqual ([2,1], [5,6]) (List.partition p2 [2,5,6,1]),
16 test "partition doc check 1" <| assertEqual ([0,1,2], [3,4,5]) (partition p2 [0..5]),
17 test "partition doc check 2" <| assertEqual ([0,2,4], [1,3,5]) (partition isEven [0..5]),
21 in test "partition stress test" <| assertEqual (ts, fs) (partition p1 (fs++ts))
23 unzipTests = suite "unzip Tests" [
24 test "unzip doc check" <| assertEqual ([0,17,1337],[True,False,True]) (unzip [(0, True), (17, False), (1337, True)]),
28 in test "unzip stress test" <| assertEqual (ts, fs) (unzip (zip ts fs))
30 intersperseTests = suite "intersperse Tests" [
31 test "intersperse doc check" <| assertEqual ["turtles","on","turtles","on","turtles"] (intersperse "on" ["turtles","turtles","turtles"]),
35 in test "intersperse stress test" <| assertEqual (tail . List.concat <| zipWith (\x y -> [x,y]) fs ts)
36 (intersperse False ts)
38 in suite "List Tests" [partitionTests, unzipTests, intersperseTests]
keysesc to close
- j k
- move down, up
- enter
- open
- esc
- back, or up a level
- 1 2 3 4
- readme, files, commits, refs
- /
- filter
- y
- copy the clone command
- c
- compare the chosen commit with another (or shift-click both)
- ?
- show or hide this list