Skip to content

Commit

Permalink
Fix hPutBuilder test on Windows platform
Browse files Browse the repository at this point in the history
  • Loading branch information
Bodigrim committed Nov 10, 2020
1 parent 4d9b403 commit 059af04
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion tests/builder/Data/ByteString/Builder/Tests.hs
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ import qualified Data.ByteString.Builder.Prim as BP
import Data.ByteString.Builder.Prim.TestUtils

import Control.Exception (evaluate)
import System.IO (openTempFile, hPutStr, hClose, hSetBinaryMode)
import System.IO (openTempFile, hPutStr, hClose, hSetBinaryMode, hSetNewlineMode, noNewlineTranslation)
import System.IO (hSetEncoding, utf8)
import System.Directory
import Foreign (ForeignPtr, withForeignPtr, castPtr)
Expand Down Expand Up @@ -114,6 +114,7 @@ testHandlePutBuilder =
(tempFile, tempH) <- openTempFile tempDir "TestBuilder"
-- switch to UTF-8 encoding
hSetEncoding tempH utf8
hSetNewlineMode tempH noNewlineTranslation
-- output recipe with intermediate direct writing to handle
let b = fst $ recipeComponents recipe
hPutStr tempH before
Expand Down

0 comments on commit 059af04

Please sign in to comment.