Skip to content

Commit

Permalink
turn of typed-process tests because of fpco/typed-process#38
Browse files Browse the repository at this point in the history
  • Loading branch information
Tom Sydney Kerckhove committed Mar 19, 2021
1 parent 62c3f77 commit 935ff18
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 7 deletions.
2 changes: 1 addition & 1 deletion sydtest-typed-process/package.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ tests:
- -with-rtsopts=-N
- -Wall
dependencies:
- stm
- bytestring
- sydtest
- sydtest-typed-process
- typed-process
2 changes: 1 addition & 1 deletion sydtest-typed-process/sydtest-typed-process.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ test-suite sydtest-typed-process-test
sydtest-discover:sydtest-discover
build-depends:
base >=4.7 && <5
, stm
, bytestring
, sydtest
, sydtest-typed-process
, typed-process
Expand Down
20 changes: 15 additions & 5 deletions sydtest-typed-process/test/Test/Syd/Process/TypedSpec.hs
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,23 @@

module Test.Syd.Process.TypedSpec (spec) where

import Control.Monad.STM
import qualified Data.ByteString as SB
import System.IO
import System.Process.Typed
import Test.Syd
import Test.Syd.Process.Typed

spec :: Spec
spec = typedProcessSpec (setStdout byteStringOutput $ shell "echo hi") $ do
it "can communicate with the process" $ \ph -> do
stdout <- atomically $ getStdout ph
stdout `shouldBe` "hi\n"
spec = typedProcessSpec (setStdin createPipe $ setStdout createPipe $ setStderr inherit $ proc "cat" []) $ do
-- This test fails, see
-- https://github.com/fpco/typed-process/issues/38
xit "can communicate with the process" $ \ph -> do
let inHandle = getStdin ph
let outHandle = getStdout ph
let contents = "Hello world"
hSetBuffering inHandle NoBuffering
hSetBuffering outHandle NoBuffering
SB.hPut inHandle contents
hFlush inHandle
output <- SB.hGet outHandle (SB.length contents)
output `shouldBe` contents

0 comments on commit 935ff18

Please sign in to comment.