store-streaming 0.2.0.2 → 0.2.0.3
raw patch · 3 files changed
+18/−7 lines, 3 files
Files
- ChangeLog.md +4/−0
- store-streaming.cabal +2/−2
- test/Data/Store/StreamingSpec.hs +12/−5
ChangeLog.md view
@@ -1,5 +1,9 @@ # ChangeLog +## 0.2.0.3++* Test compilation fixed with `network >= 3`.+ ## 0.2.0.2 * Now only depends on `fail` / `semigroups` shim for `ghc < 8`.
store-streaming.cabal view
@@ -4,10 +4,10 @@ -- -- see: https://github.com/sol/hpack ----- hash: 1eccab59dd693d655abf5e296f92128cc1b91c649a5b1997b64e1bc1a8a4b74c+-- hash: cd65b31035b92434fdc9c7a6f868357f6dc55065531d3a3c1afc89059faf562e name: store-streaming-version: 0.2.0.2+version: 0.2.0.3 synopsis: Streaming interfaces for `store` category: Serialization, Data homepage: https://github.com/fpco/store#readme
test/Data/Store/StreamingSpec.hs view
@@ -23,7 +23,6 @@ import Data.Streaming.Network (runTCPServer, runTCPClient, clientSettingsTCP, serverSettingsTCP, setAfterBind) import Data.Streaming.Network.Internal (AppData(..)) import Data.Void (absurd, Void)-import Network.Socket (Socket(..), socketPort) import Network.Socket.ByteString (send) import qualified System.IO.ByteBuffer as BB import System.Posix.Types (Fd(..))@@ -31,6 +30,13 @@ import Test.Hspec.SmallCheck import Test.SmallCheck +#if MIN_VERSION_network(3,0,0)+import Network.Socket (Socket, socketPort, withFdSocket)+#else+import Network.Socket (Socket(..), socketPort)+import Foreign.C.Types (CInt)+#endif+ spec :: Spec spec = do describe "conduitEncode and conduitDecode" $ do@@ -130,9 +136,10 @@ Pure (Message x') -> return $ x' == x #ifndef mingw32_HOST_OS--socketFd :: Socket -> Fd-socketFd (MkSocket fd _ _ _ _) = Fd fd+#if !MIN_VERSION_network(3,0,0)+withFdSocket :: Socket -> (CInt -> IO r) -> IO r+withFdSocket (MkSocket fd _ _ _ _) f = f fd+#endif withServer :: (Socket -> Socket -> IO a) -> IO a withServer cont = do@@ -177,7 +184,7 @@ (forM_ chunks $ \chunk -> do void (send sock1 chunk) threadDelay (10 * 1000))- (decodeMessageFd bb (socketFd sock2))+ (withFdSocket sock2 (decodeMessageFd bb . Fd)) return (v == v') #endif