Skip to content

Commit

Permalink
add test case for mergeSource item dropping
Browse files Browse the repository at this point in the history
  • Loading branch information
julmb committed Aug 26, 2024
1 parent ab68cdc commit a200ebd
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions conduit/test/main.hs
Original file line number Diff line number Diff line change
Expand Up @@ -704,6 +704,12 @@ main = hspec $ do
withShortAlphaIndex = CI.mergeSource (CL.sourceList ["A", "B", "C"])
output <- runConduit $ src .| withShortAlphaIndex .| CL.consume
output `shouldBe` [("A", 1), ("B", 2), ("C", 3)]
it "does not drop upstream items" $ do
let num = CL.sourceList [1 .. 10 :: Int]
let chr = CL.sourceList ['a' .. 'c']
(output, remainder) <- runConduit $ num .| liftA2 (,) (CI.mergeSource chr .| CL.consume) CL.consume
output `shouldBe` [('a', 1), ('b', 2), ('c', 3)]
remainder `shouldBe` [4 .. 10]

describe "passthroughSink" $ do
it "works" $ do
Expand Down

0 comments on commit a200ebd

Please sign in to comment.