@@ -42,5 +42,26 @@ spec = describe "conduit" $ do
4242 x <- replicateM 15 $ readCSource csrc
4343 S.concat x `shouldBe` "12345678"
4444
45+ y <- replicateM 15 $ readSource src
46+ S.concat y `shouldBe` "BLAH"
47+ it "chunk boundaries" $ do
48+ ref <- newIORef
49+ [ "5\r\n"
50+ , "12345\r\n3\r"
51+ , "\n678\r\n0\r\n"
52+ , "\r\nBLAH"
53+ ]
54+ src <- mkSource $ do
55+ x <- readIORef ref
56+ case x of
57+ [] -> return S.empty
58+ y:z -> do
59+ writeIORef ref z
60+ return y
61+ csrc <- mkCSource src
62+
63+ x <- replicateM 15 $ readCSource csrc
64+ S.concat x `shouldBe` "12345678"
65+
4566 y <- replicateM 15 $ readSource src
4667 S.concat y `shouldBe` "BLAH"