rename some props, as @jhodgdev suggested
This commit is contained in:
parent
3bb4d752e5
commit
937b69a50c
1 changed files with 11 additions and 11 deletions
|
|
@ -25,9 +25,9 @@ import Test.Tasty.QuickCheck (testProperty)
|
||||||
|
|
||||||
tests :: [TestTree]
|
tests :: [TestTree]
|
||||||
tests =
|
tests =
|
||||||
[ testProperty "'pmsort' sorts a list properly" prop_msortSorted
|
[ testProperty "'pmsort' sorts a list properly" prop_msortCorrect
|
||||||
, testProperty "'pmerge' merges two sorted lists into one sorted list" prop_mergeSorted
|
, testProperty "'pmerge' merges two sorted lists into one sorted list" prop_mergeCorrect
|
||||||
, testProperty "'phalve' splits a list in half as expected" prop_halveProperly
|
, testProperty "'phalve' splits a list in half as expected" prop_halveCorrect
|
||||||
, testProperty "'pnubSort' sorts a list and remove duplicate elements" prop_nubSortProperly
|
, testProperty "'pnubSort' sorts a list and remove duplicate elements" prop_nubSortProperly
|
||||||
, testProperty "'pisUniq' can tell whether all elements in a list are unique" prop_uniqueList
|
, testProperty "'pisUniq' can tell whether all elements in a list are unique" prop_uniqueList
|
||||||
]
|
]
|
||||||
|
|
@ -35,8 +35,8 @@ tests =
|
||||||
--------------------------------------------------------------------------------
|
--------------------------------------------------------------------------------
|
||||||
|
|
||||||
-- | Yield true if 'Agora.Utils.pmsort' sorts a given list correctly.
|
-- | Yield true if 'Agora.Utils.pmsort' sorts a given list correctly.
|
||||||
prop_msortSorted :: [Integer] -> Bool
|
prop_msortCorrect :: [Integer] -> Bool
|
||||||
prop_msortSorted l = sorted == expected
|
prop_msortCorrect l = sorted == expected
|
||||||
where
|
where
|
||||||
-- Expected sorted list, using 'Data.List.sort'.
|
-- Expected sorted list, using 'Data.List.sort'.
|
||||||
expected :: [Integer]
|
expected :: [Integer]
|
||||||
|
|
@ -51,8 +51,8 @@ prop_msortSorted l = sorted == expected
|
||||||
sorted = plift psorted
|
sorted = plift psorted
|
||||||
|
|
||||||
-- | Yield true if 'Agora.Utils.pmerge' merges two list into a ordered list correctly.
|
-- | Yield true if 'Agora.Utils.pmerge' merges two list into a ordered list correctly.
|
||||||
prop_mergeSorted :: [Integer] -> [Integer] -> Bool
|
prop_mergeCorrect :: [Integer] -> [Integer] -> Bool
|
||||||
prop_mergeSorted a b = merged == expected
|
prop_mergeCorrect a b = merged == expected
|
||||||
where
|
where
|
||||||
-- Sorted list a and b
|
-- Sorted list a and b
|
||||||
sa = sort a
|
sa = sort a
|
||||||
|
|
@ -77,11 +77,11 @@ prop_mergeSorted a b = merged == expected
|
||||||
merged :: [Integer]
|
merged :: [Integer]
|
||||||
merged = plift pmerged
|
merged = plift pmerged
|
||||||
|
|
||||||
{- | Yield true if plutarch level 'Agora.Utils.phalve' splits a given list
|
{- | Yield true if Plutarch level 'Agora.Utils.phalve' splits a given list
|
||||||
as its haskell level counterpart does.
|
as its Haskell level counterpart does.
|
||||||
-}
|
-}
|
||||||
prop_halveProperly :: [Integer] -> Bool
|
prop_halveCorrect :: [Integer] -> Bool
|
||||||
prop_halveProperly l = halved == expected
|
prop_halveCorrect l = halved == expected
|
||||||
where
|
where
|
||||||
-- Halve a list.
|
-- Halve a list.
|
||||||
halve :: [Integer] -> ([Integer], [Integer])
|
halve :: [Integer] -> ([Integer], [Integer])
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue