From 059af04d58f425852b24b815429cc5feaf74fe10 Mon Sep 17 00:00:00 2001 From: Bodigrim Date: Thu, 5 Nov 2020 20:17:18 +0000 Subject: [PATCH] Fix hPutBuilder test on Windows platform --- tests/builder/Data/ByteString/Builder/Tests.hs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tests/builder/Data/ByteString/Builder/Tests.hs b/tests/builder/Data/ByteString/Builder/Tests.hs index 0c1d405e9..3c0a69ca7 100644 --- a/tests/builder/Data/ByteString/Builder/Tests.hs +++ b/tests/builder/Data/ByteString/Builder/Tests.hs @@ -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) @@ -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