Skip to content

Commit

Permalink
groupBy test will also test with randomly generated function argument
Browse files Browse the repository at this point in the history
  • Loading branch information
jcmartin authored and BebeSparkelSparkel committed Nov 28, 2024
1 parent ce0fcd1 commit 95c991b
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion mono-traversable/test/Main.hs
Original file line number Diff line number Diff line change
Expand Up @@ -150,13 +150,14 @@ main = hspec $ do
ocompareLength (replicate i () :: [()]) j @?= compare i j

describe "groupBy" $ do
let test name dummy = prop name $ \xs -> do
let test name dummy = prop name $ \xs (Fn2 g) -> do
let seq' = fromListAs xs dummy
let listDef f = Prelude.fmap fromList . List.groupBy f . otoList
groupBy (==) seq' @?= listDef (==) seq'
groupBy (/=) seq' @?= listDef (/=) seq'
groupBy (<) seq' @?= listDef (<) seq'
groupBy (>) seq' @?= listDef (>) seq'
groupBy g seq' @?= listDef g seq'
test "works on lists" ([] :: [Char])
test "works on texts" ("" :: Text)
test "works on strict bytestrings" S.empty
Expand Down

0 comments on commit 95c991b

Please sign in to comment.