Commit 76b39f0b authored by Don Stewart's avatar Don Stewart
Browse files

More QC tests. Update output

parent 78806c96
......@@ -147,6 +147,8 @@ prop_packunpack' s = (P.pack . P.unpack) s == id s
-- at first we just check the correspondence to List functions
prop_eq1 xs = xs == (unpack . pack $ xs)
prop_eq2 xs = xs == xs
prop_eq3 xs ys = (xs == ys) == (unpack xs == unpack ys)
prop_compare1 xs = (pack xs `compare` pack xs) == EQ
prop_compare2 xs c = (pack (xs++[c]) `compare` pack xs) == GT
......@@ -192,9 +194,14 @@ prop_append2 xs ys = (xs ++ ys) == (unpack $ pack xs `P.append` pack ys)
prop_map xs = map toLower xs == (unpack . (P.map toLower) . pack) xs
prop_filter1 xs = (filter (=='X') xs) == (unpack $ P.filter (=='X') (pack xs))
prop_filter2 xs c = (filter (==c) xs) == (unpack $ P.filter (==c) (pack xs))
prop_filter2 p xs = (filter p xs) == (unpack $ P.filter p (pack xs))
prop_find xs c = find (==c) xs == P.find (==c) (pack xs)
prop_find p xs = find p xs == P.find p (pack xs)
prop_find_findIndex p xs =
P.find p xs == case P.findIndex p xs of
Just n -> Just (xs `P.unsafeIndex` n)
_ -> Nothing
prop_foldl1 xs a = ((foldl (\x c -> if c == a then x else c:x) [] xs)) ==
(unpack $ P.foldl (\x c -> if c == a then x else c `P.cons` x) P.empty (pack xs))
......@@ -432,6 +439,8 @@ main = do
, ("pack/unpack", mytest prop_packunpack)
, ("unpack/pack", mytest prop_packunpack')
, ("eq1", mytest prop_eq1)
, ("eq2", mytest prop_eq3)
, ("eq3", mytest prop_eq3)
, ("compare1", mytest prop_compare1)
, ("compare2", mytest prop_compare2)
, ("compare3", mytest prop_compare3)
......@@ -497,6 +506,7 @@ main = do
, ("findIndicies", mytest prop_findIndicies)
, ("elemIndices", mytest prop_elemIndices)
, ("find", mytest prop_find)
, ("find/findIndex", mytest prop_find_findIndex)
, ("sort1", mytest prop_sort1)
, ("sort2", mytest prop_sort2)
, ("sort3", mytest prop_sort3)
......
......@@ -3,6 +3,8 @@ bijection' : 01234567891011121314151617181920
pack/unpack : 0123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899OK, 100 tests.
unpack/pack : 0123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899OK, 100 tests.
eq1 : 0123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899OK, 100 tests.
eq2 : 0123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899OK, 100 tests.
eq3 : 0123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899OK, 100 tests.
compare1 : 0123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899OK, 100 tests.
compare2 : 0123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899OK, 100 tests.
compare3 : 0123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899OK, 100 tests.
......@@ -67,6 +69,7 @@ findIndex : 01234567891011121314151617181920
findIndicies : 0123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899OK, 100 tests.
elemIndices : 0123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899OK, 100 tests.
find : 0123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899OK, 100 tests.
find/findIndex : 0123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899OK, 100 tests.
sort1 : 0123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899OK, 100 tests.
sort2 : 01223445567778991010111112121313141516171717181920212223242526272829303031323334353637373738393940414243444546474848495050515253545556575859596060616161626364656667686970717273747575767778787980818283838485868788899091929394959696979899OK, 100 tests.
sort3 : 01223445567778991010111112121313141516171717181920212223242526272829303031323334353637373738393940414243444546474848495050515253545556575859596060616161626364656667686970717273747575767778787980818283838485868788899091929394959696979899OK, 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