From c8e64b65aec4247d5942d5fe0006ac6d525f4efe Mon Sep 17 00:00:00 2001 From: Tom McLaughlin Date: Wed, 28 Jun 2023 05:05:58 -0700 Subject: [PATCH] Improve output when TSC check fails --- test/Util.hs | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/test/Util.hs b/test/Util.hs index 88a088d..8436f05 100644 --- a/test/Util.hs +++ b/test/Util.hs @@ -70,12 +70,19 @@ testTypeCheckDeclarations tsDeclarations typesAndVals = withSystemTempDirectory writeFile tsFile contents tsc <- getTSC - (code, output, _err) <- readProcessWithExitCode tsc ["--strict", "--noEmit", "--skipLibCheck", "--traceResolution", "--noResolve", tsFile] "" + (code, sout, serr) <- readProcessWithExitCode tsc ["--strict", "--noEmit", "--skipLibCheck", "--traceResolution", "--noResolve", tsFile] "" - when (code /= ExitSuccess) $ do - error [i|TSC check failed: #{output}. File contents were\n\n#{contents}|] + when (code /= ExitSuccess) $ + error [__i|TSC check failed. + File contents: + #{contents} - return () + Stdout: + #{sout} + + Stderr: + #{serr} + |] ensureTSCExists :: IO ()