Repository : ssh://darcs.haskell.org//srv/darcs/testsuite

On branch  : ghc-7.2

http://hackage.haskell.org/trac/ghc/changeset/19095e0e6feb2216b295b504513f5d09cc778253

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

commit 19095e0e6feb2216b295b504513f5d09cc778253
Author: Simon Marlow <marlo...@gmail.com>
Date:   Tue Jul 19 13:37:37 2011 +0100

    When the output files differ, present the diffs between the *actual*
    output, not the normalised output.  The latter may have newlines
    removed, making the diff unreadable.  I broke this recently, but it
    was only working by accident, now it is working by design (and is
    commented, to boot).

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

 driver/testlib.py |   14 ++++++++++----
 1 files changed, 10 insertions(+), 4 deletions(-)

diff --git a/driver/testlib.py b/driver/testlib.py
index 2ad5764..75d641f 100644
--- a/driver/testlib.py
+++ b/driver/testlib.py
@@ -1418,14 +1418,20 @@ def compare_outputs( kind, normaliser, extra_normaliser,
 
         # Ignore whitespace when diffing. We should only get to this
         # point if there are non-whitespace differences
-        r = os.system( 'diff -uw ' + expected_normalised_file + \
-                               ' ' + actual_normalised_file )
+        #
+        # Note we are diffing the *actual* output, not the normalised
+        # output.  The normalised output may have whitespace squashed
+        # (including newlines) so the diff would be hard to read.
+        # This does mean that the diff might contain changes that
+        # would be normalised away.
+        r = os.system( 'diff -uw ' + expected_file + \
+                               ' ' + actual_file )
 
         # If for some reason there were no non-whitespace differences,
         # then do a full diff
         if r == 0:
-            r = os.system( 'diff -u ' + expected_normalised_file + \
-                                  ' ' + actual_normalised_file )
+            r = os.system( 'diff -u ' + expected_file + \
+                                  ' ' + actual_file )
 
         if config.accept:
             if expected_file == '':



_______________________________________________
Cvs-ghc mailing list
Cvs-ghc@haskell.org
http://www.haskell.org/mailman/listinfo/cvs-ghc

Reply via email to