1{-# LANGUAGE OverloadedStrings #-}
2module ConduitSpec (main, spec) where
4import Network.Wai.Handler.Warp.Conduit
5import Network.Wai.Handler.Warp.Types
6import Control.Monad (replicateM)
9import qualified Data.ByteString as S
15spec = describe "conduit" $ do
16 it "IsolatedBSSource" $ do
17 ref <- newIORef $ map S.singleton [1..50]
25 isrc <- mkISource src 40
26 x <- replicateM 20 $ readISource isrc
27 S.concat x `shouldBe` S.pack [1..20]
29 y <- replicateM 40 $ readISource isrc
30 S.concat y `shouldBe` S.pack [21..40]
32 z <- replicateM 40 $ readSource src
33 S.concat z `shouldBe` S.pack [41..50]
34 it "chunkedSource" $ do
35 ref <- newIORef $ "5\r\n12345\r\n3\r\n678\r\n0\r\n\r\nBLAH"
38 writeIORef ref S.empty
42 x <- replicateM 15 $ readCSource csrc
43 S.concat x `shouldBe` "12345678"
45 y <- replicateM 15 $ readSource src
46 S.concat y `shouldBe` "BLAH"
47 it "chunk boundaries" $ do
63 x <- replicateM 15 $ readCSource csrc
64 S.concat x `shouldBe` "12345678"
66 y <- replicateM 15 $ readSource src
67 S.concat y `shouldBe` "BLAH"
keysesc to close
- j k
- move down, up
- enter
- open
- esc
- back, or up a level
- 1 2 3 4
- readme, files, commits, refs
- /
- filter
- y
- copy the clone command
- c
- compare the chosen commit with another (or shift-click both)
- ?
- show or hide this list