Unique 0.4.6 → 0.4.6.1
raw patch · 3 files changed
+11/−11 lines, 3 filesdep ~basePVP ok
version bump matches the API change (PVP)
Dependency ranges changed: base
API changes (from Hackage documentation)
Files
- Unique.cabal +3/−3
- tests/IsUnique.hs +4/−8
- tests/RepeatedBy.hs +4/−0
Unique.cabal view
@@ -1,6 +1,6 @@ name: Unique -version: 0.4.6+version: 0.4.6.1 synopsis: It provides the functionality like unix "uniq" utility description: Library provides the functions to find unique and duplicate elements in the list@@ -21,7 +21,7 @@ Data.List.UniqueStrict, Data.List.UniqueUnsorted - build-depends: base >=4.0 && < 5+ build-depends: base >=4.0 && < 4.10 , extra , containers , hashable@@ -39,7 +39,7 @@ , RepeatedBy , SortUniq - build-depends: base >=4.8 && <4.9+ build-depends: base >=4.0 && < 4.10 , hspec , containers , QuickCheck
tests/IsUnique.hs view
@@ -47,16 +47,14 @@ it "isUnique should return (Just ANY) when element is exist in the list" $ property $- \ ( NonEmpty ls@(x:xs) )- -> not (null xs)- ==> isJust (isUnique (x :: Char) ls)+ \ ( NonEmpty ls@(x:_) )+ -> isJust (isUnique (x :: Char) ls) context "isUnique should return (Just False) when at least two elements are exist in the list" $ it "- It checks laziness as well" $ property $- \ ( NonEmpty ls@(x:xs) )- -> not (null xs)- ==> isJust $ isUnique (x :: Char) (ls ++ [x, undefined])+ \ ( NonEmpty ls@(x:_) )+ -> isJust $ isUnique (x :: Char) (ls ++ [x, undefined]) it "isUnique should return Nothing when element is absent in the list" $ property $@@ -70,5 +68,3 @@ -> notElem x xs ==> isNothing (isUnique (x :: Char) xs) && isNothing (isRepeated x xs)--
tests/RepeatedBy.hs view
@@ -51,6 +51,10 @@ property $ \ xs -> unique (xs :: String) == unique (unique xs) + it "repeated: multiple execution should return []" $+ property $+ \ xs -> null (repeated (repeated (xs :: String) ))+ it "repeated && unique: should return different result on the same non empty list" $ property $ \ xs -> not (null xs)