[commit: packages/filepath] master: quickSafe: do not call show on already escaped output (#30) (7392405)

git at git.haskell.org git at git.haskell.org
Thu Mar 19 11:35:39 UTC 2015


Repository : ssh://git@git.haskell.org/filepath

On branch  : master
Link       : http://git.haskell.org/packages/filepath.git/commitdiff/739240511a9a8b978d726a4ea7832bc6d1a9bb0d

>---------------------------------------------------------------

commit 739240511a9a8b978d726a4ea7832bc6d1a9bb0d
Author: Thomas Miedema <thomasmiedema at gmail.com>
Date:   Tue Oct 28 15:22:35 2014 +0100

    quickSafe: do not call show on already escaped output (#30)
    
    This output:
    
       *** Failed! ... QFilePath "/\\?/a:a"
    
    is much easier to digest than:
    
       "*** FAILED! ... \NQFILEPATH \"/\\\\?/A:A\"\N"


>---------------------------------------------------------------

739240511a9a8b978d726a4ea7832bc6d1a9bb0d
 tests/AutoTest.hs | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/tests/AutoTest.hs b/tests/AutoTest.hs
index 56b6ec6..e65960b 100644
--- a/tests/AutoTest.hs
+++ b/tests/AutoTest.hs
@@ -40,4 +40,5 @@ quickSafe prop = do
     res <- quickCheckWithResult stdArgs{chatty=False, maxSuccess=10000} prop
     case res of
         Success{} -> return ()
-        _ -> error $ show res
+        -- Output is already escaped. Do not call show on it, but print as-is.
+        _ -> error $ show res{output=""} ++ "\n" ++ (output res)



More information about the ghc-commits mailing list