Commit dc6d798d authored by Don Stewart's avatar Don Stewart
Browse files

More QC properties, for fold{lr}1. Update expected output

parent 7c2ceae4
......@@ -192,11 +192,27 @@ prop_foldl1_1 xs =
P.foldl1 (\x c -> if c > x then c else x) xs ==
P.foldl (\x c -> if c > x then c else x) '\0' xs
prop_foldl1_2 xs =
(not . P.null) xs ==>
P.foldl1 const xs == P.head xs
prop_foldl1_3 xs =
(not . P.null) xs ==>
P.foldl1 (flip const) xs == P.last xs
prop_foldr1_1 xs =
(not . P.null) xs ==>
P.foldr1 (\c x -> if c > x then c else x) xs ==
P.foldr (\c x -> if c > x then c else x) '\0' xs
prop_foldr1_2 xs =
(not . P.null) xs ==>
P.foldr1 (flip const) xs == P.last xs
prop_foldr1_3 xs =
(not . P.null) xs ==>
P.foldr1 const xs == P.head xs
prop_takeWhile xs = (takeWhile (/= 'X') xs) == (unpack . (P.takeWhile (/= 'X')) . pack) xs
prop_dropWhile xs = (dropWhile (/= 'X') xs) == (unpack . (P.dropWhile (/= 'X')) . pack) xs
......@@ -401,6 +417,15 @@ main = do
, ("foldl2", mytest prop_foldl2)
, ("foldr1", mytest prop_foldr1)
, ("foldr2", mytest prop_foldr2)
, ("foldl1_1", mytest prop_foldl1_1)
, ("foldl1_2", mytest prop_foldl1_2)
, ("foldl1_3", mytest prop_foldl1_3)
, ("foldr1_1", mytest prop_foldr1_1)
, ("foldr1_2", mytest prop_foldr1_2)
, ("foldr1_3", mytest prop_foldr1_3)
, ("all", mytest prop_all)
, ("take", mytest prop_take)
, ("drop", mytest prop_drop)
......
......@@ -25,6 +25,12 @@ foldl1 : 01234567891011121314151617181920
foldl2 : 0123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899OK, 100 tests.
foldr1 : 0123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899OK, 100 tests.
foldr2 : 0123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899OK, 100 tests.
foldl1_1 : 01223445567788910111111121213141415161616171718192021222324252627282930303031323334353637383940414243444545454647484950505152535354555657585859606061616162636465666768697071727374757576777879808182838485858687888990919293949596979899OK, 100 tests.
foldl1_2 : 01223445567788910111111121213141415161616171718192021222324252627282930303031323334353637383940414243444545454647484950505152535354555657585859606061616162636465666768697071727374757576777879808182838485858687888990919293949596979899OK, 100 tests.
foldl1_3 : 01223445567788910111111121213141415161616171718192021222324252627282930303031323334353637383940414243444545454647484950505152535354555657585859606061616162636465666768697071727374757576777879808182838485858687888990919293949596979899OK, 100 tests.
foldr1_1 : 01223445567788910111111121213141415161616171718192021222324252627282930303031323334353637383940414243444545454647484950505152535354555657585859606061616162636465666768697071727374757576777879808182838485858687888990919293949596979899OK, 100 tests.
foldr1_2 : 01223445567788910111111121213141415161616171718192021222324252627282930303031323334353637383940414243444545454647484950505152535354555657585859606061616162636465666768697071727374757576777879808182838485858687888990919293949596979899OK, 100 tests.
foldr1_3 : 01223445567788910111111121213141415161616171718192021222324252627282930303031323334353637383940414243444545454647484950505152535354555657585859606061616162636465666768697071727374757576777879808182838485858687888990919293949596979899OK, 100 tests.
all : 0123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899OK, 100 tests.
take : 0123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899OK, 100 tests.
drop : 0123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899OK, 100 tests.
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment