1 module StdAssocListTest
3 /* Test module StdAssocList
5 (*) gebruik Environment 'Gast'
6 (*) zet Project Options op 'Basic Values Only' en '2M' Maximum Heap Size
15 newAssocList_is_leeg /\
16 aantal_elementen_klopt x /\
17 lookup_after_update x /\
18 lookup_after_update2 x /\
23 newIntStringAssocList :: AssocList Int String
24 newIntStringAssocList = newAssocList
26 vulIntStringAssocList :: (AssocList Int String) Int -> AssocList Int String
27 vulIntStringAssocList l n = seq [updateKey k (toString k) \\ k <- [1..n]] l
29 newAssocList_is_leeg :: Property
30 newAssocList_is_leeg = name "newAssocList_is_leeg"
31 (countValues newIntStringAssocList == 0)
33 aantal_elementen_klopt :: Int -> Property
34 aantal_elementen_klopt n = name "aantal_elementen_klopt"
35 (countValues (vulIntStringAssocList newIntStringAssocList n`) == max 0 n`)
38 lookup_after_update :: Int -> Property
39 lookup_after_update n = name "lookup_after_update"
40 (lookupKey k (updateKey k v (vulIntStringAssocList newIntStringAssocList n`)) == [v])
45 lookup_after_update2 :: Int -> Property
46 lookup_after_update2 n = name "lookup_after_update"
47 (lookupKey k (vulIntStringAssocList (updateKey k v newIntStringAssocList) n`) == [v])
52 keys_zijn_uniek :: Int -> Property
53 keys_zijn_uniek n = name "keys_zijn_uniek"
54 (lookupKey k (removeKey k (vulIntStringAssocList newIntStringAssocList n`)) == [])