From dd8b4ecd2a6f515695bf09f2f6700df12917ce8d Mon Sep 17 00:00:00 2001 From: Jordan Millar Date: Tue, 19 Nov 2024 13:14:26 -0400 Subject: [PATCH] hGetContents' is not available in ghc-8.10.7. Try hGetContents from Data.Text.IO --- cardano-api/gen/Test/Hedgehog/Golden/ErrorMessage.hs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/cardano-api/gen/Test/Hedgehog/Golden/ErrorMessage.hs b/cardano-api/gen/Test/Hedgehog/Golden/ErrorMessage.hs index 0d1b193ce..057224775 100644 --- a/cardano-api/gen/Test/Hedgehog/Golden/ErrorMessage.hs +++ b/cardano-api/gen/Test/Hedgehog/Golden/ErrorMessage.hs @@ -14,6 +14,8 @@ import Data.Algorithm.Diff (PolyDiff (Both), getGroupedDiff) import Data.Algorithm.DiffOutput (ppDiff) import Data.Data import qualified Data.List as List +import qualified Data.Text as Text +import qualified Data.Text.IO as Text import GHC.Stack (HasCallStack, withFrozenCallStack) import qualified GHC.Stack as GHC import qualified System.Directory as IO @@ -181,7 +183,7 @@ checkAgainstGoldenFile checkAgainstGoldenFile goldenFile actualLines = GHC.withFrozenCallStack $ do referenceLines <- liftIO $ IO.withFile goldenFile IO.ReadMode $ \handle -> do IO.hSetEncoding handle IO.utf8 - List.lines <$> IO.hGetContents' handle + List.lines . Text.unpack <$> Text.hGetContents handle let difference = getGroupedDiff actualLines referenceLines case difference of [] -> pure ()