Skip to content

Commit

Permalink
Added all types to inits and tails tests, removed extream benchmark
Browse files Browse the repository at this point in the history
  • Loading branch information
BebeSparkelSparkel committed Feb 28, 2024
1 parent 648f1f5 commit 84ced15
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 3 deletions.
1 change: 0 additions & 1 deletion mono-traversable/bench/InitTails.hs
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,6 @@ bmg = bgroup (testLabel @seq) $ bm <$> labelledLengths
, ("small", [100,150,200,300])
, ("medium", [1000,1500,2000,2500])
, ("large", [10000,20000,50000])
, ("extream", [1000000])
]

class Typeable a => TestLabel a where
Expand Down
12 changes: 10 additions & 2 deletions mono-traversable/test/Main.hs
Original file line number Diff line number Diff line change
Expand Up @@ -216,22 +216,30 @@ main = hspec $ do
it "empty" $ inits emptyTyp @?= [""]
it "one element" $ inits ("a" <> emptyTyp) @?= ["", "a"]
it "two elements" $ inits ("ab" <> emptyTyp) @?= ["", "a", "ab"]
test "String" (mempty :: String)
test "StrictBytestring" S.empty
test "LazyBytestring" L.empty
test "StrictText" T.empty
test "LazyText" TL.empty
test "String" (mempty :: String)
test "Seq" Seq.empty
test "Vector" (mempty :: V.Vector Char)
test "Unboxed Vector" (mempty :: U.Vector Char)
test "Storable Vector" (mempty :: VS.Vector Char)

describe "tails" $ do
let test typ emptyTyp = describe typ $ do
it "empty" $ tails emptyTyp @?= [""]
it "one element" $ tails ("a" <> emptyTyp) @?= ["a", ""]
it "two elements" $ tails ("ab" <> emptyTyp) @?= ["ab", "b", ""]
test "String" (mempty :: String)
test "StrictBytestring" S.empty
test "LazyBytestring" L.empty
test "StrictText" T.empty
test "LazyText" TL.empty
test "String" (mempty :: String)
test "Seq" Seq.empty
test "Vector" (mempty :: V.Vector Char)
test "Unboxed Vector" (mempty :: U.Vector Char)
test "Storable Vector" (mempty :: VS.Vector Char)

describe "initTails" $ do
let test typ emptyTyp = describe typ $ do
Expand Down

0 comments on commit 84ced15

Please sign in to comment.