From 72ae940774f26759c3c822c9fae19bb7a3579bb6 Mon Sep 17 00:00:00 2001 From: Mateusz Galazyn Date: Mon, 22 Jan 2024 16:55:59 +0100 Subject: [PATCH] Fix missing stderr in failed commands --- src/Hedgehog/Extras/Test/Process.hs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/Hedgehog/Extras/Test/Process.hs b/src/Hedgehog/Extras/Test/Process.hs index 4ba2039d..36484f06 100644 --- a/src/Hedgehog/Extras/Test/Process.hs +++ b/src/Hedgehog/Extras/Test/Process.hs @@ -174,8 +174,8 @@ execFlex' execConfig pkgBin envBin arguments = GHC.withFrozenCallStack $ do , "━━━━ command ━━━━" , pkgBin <> " " <> L.unwords (fmap argQuote arguments) ] - ++ if L.null stdout then [] else ["━━━━ stdout ━━━━" , stdout] - ++ if L.null stderr then [] else ["━━━━ stderr ━━━━" , stderr] + ++ (if L.null stdout then [] else ["━━━━ stdout ━━━━" , stdout]) + ++ (if L.null stderr then [] else ["━━━━ stderr ━━━━" , stderr]) H.failMessage GHC.callStack "Execute process failed" IO.ExitSuccess -> return stdout @@ -222,8 +222,8 @@ exec execConfig bin arguments = GHC.withFrozenCallStack $ do , "━━━━ command ━━━━" , bin <> " " <> L.unwords (fmap argQuote arguments) ] - ++ if L.null stdout then [] else ["━━━━ stdout ━━━━" , stdout] - ++ if L.null stderr then [] else ["━━━━ stderr ━━━━" , stderr] + ++ (if L.null stdout then [] else ["━━━━ stdout ━━━━" , stdout]) + ++ (if L.null stderr then [] else ["━━━━ stderr ━━━━" , stderr]) IO.ExitSuccess -> return stdout -- | Execute a process, returning the error code, the stdout, and the stderr.