Skip to content

Commit

Permalink
Make test compile and pass on windows
Browse files Browse the repository at this point in the history
  • Loading branch information
Jimbo4350 committed Feb 8, 2023
1 parent 00b1b67 commit a31e698
Showing 1 changed file with 17 additions and 1 deletion.
18 changes: 17 additions & 1 deletion cardano-cli/test/Test/Cli/Pipes.hs
Original file line number Diff line number Diff line change
@@ -1,12 +1,17 @@
{-# LANGUAGE CPP #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE TemplateHaskell #-}

module Test.Cli.Pipes
( tests
) where

import Prelude
#if !defined(mingw32_HOST_OS)
#define UNIX
#endif

import Prelude
#ifdef UNIX
import Control.Monad.IO.Class (liftIO)
import qualified Data.ByteString.Char8 as BSC
import qualified Data.ByteString.Lazy as LBS
Expand All @@ -21,7 +26,13 @@ import qualified Hedgehog
import qualified Hedgehog.Extras.Test.Base as H
import Hedgehog.Internal.Property (failWith)

#else

import Hedgehog (Property, discover, property, success)

#endif

#ifdef UNIX
prop_readFromPipe :: Property
prop_readFromPipe =
H.propertyOnce . H.moduleWorkspace "tmp" $ \_ -> do
Expand Down Expand Up @@ -66,6 +77,11 @@ withPipe contents = do
closeFd readEnd
pure readContents

#else
prop_readFromPipe :: Property
prop_readFromPipe = property success
#endif

-- -----------------------------------------------------------------------------

tests :: IO Bool
Expand Down

0 comments on commit a31e698

Please sign in to comment.