on 577fc17 help sign in
27 lines 644 B history raw
1module Test.Set (tests) where
3import Set
4import Set (Set)
5import List
7import ElmTest.Assertion (..)
8import ElmTest.Test (..)
10set : Set Int
11set = Set.fromList [1..100]
13setPart1 : Set Int
14setPart1 = Set.fromList [1..50]
16setPart2 : Set Int
17setPart2 = Set.fromList [51..100]
19pred : Int -> Bool
20pred x = x <= 50
22tests : Test
23tests =
24 let
25 filterTests = suite "filter Tests" [test "Simple filter" <| assertEqual setPart1 <| Set.filter pred set]
26 partitionTests = suite "partition Tests" [test "Simple partition" <| assertEqual (setPart1, setPart2) <| Set.partition pred set]
27 in suite "Set Tests" [partitionTests, filterTests]