[gobject-introspection] tests: fix diff output



commit e4907187dd57c1a0e572fd8bd1eb39d07842ef1d
Author: Dieter Verfaillie <dieterv optionexplicit be>
Date:   Wed Jul 31 07:18:03 2013 +0200

    tests: fix diff output
    
    Empty lines do get removed or added sometimes, so make sure we see
    those in our diff output.

 tests/scanner/annotationparser/test_parser.py |    9 +++------
 tests/warn/warningtester.py                   |    9 +++------
 2 files changed, 6 insertions(+), 12 deletions(-)
---
diff --git a/tests/scanner/annotationparser/test_parser.py b/tests/scanner/annotationparser/test_parser.py
index 5234451..b1b8734 100644
--- a/tests/scanner/annotationparser/test_parser.py
+++ b/tests/scanner/annotationparser/test_parser.py
@@ -320,21 +320,18 @@ class TestCommentBlock(unittest.TestCase):
                 if tag == 'equal':
                     for line in a[i1:i2]:
                         for l in line.split('\n'):
-                            if l != '':
-                                retval += ' ' + l + '\n'
+                            retval += ' ' + l + '\n'
                     continue
 
                 if tag in ('replace', 'delete'):
                     for line in a[i1:i2]:
                         for l in line.split('\n'):
-                            if l != '':
-                                retval += '-' + l + '\n'
+                            retval += '-' + l + '\n'
 
                 if tag in ('replace', 'insert'):
                     for line in b[j1:j2]:
                         for l in line.split('\n'):
-                            if l != '':
-                                retval += '+' + l + '\n'
+                            retval += '+' + l + '\n'
 
         return retval
 
diff --git a/tests/warn/warningtester.py b/tests/warn/warningtester.py
index 63a1e64..2192a95 100644
--- a/tests/warn/warningtester.py
+++ b/tests/warn/warningtester.py
@@ -60,21 +60,18 @@ def _diff(a, b):
             if tag == 'equal':
                 for line in a[i1:i2]:
                     for l in line.split('\n'):
-                        if l != '':
-                            retval += ' ' + l + '\n'
+                        retval += ' ' + l + '\n'
                 continue
 
             if tag in ('replace', 'delete'):
                 for line in a[i1:i2]:
                     for l in line.split('\n'):
-                        if l != '':
-                            retval += '-' + l + '\n'
+                        retval += '-' + l + '\n'
 
             if tag in ('replace', 'insert'):
                 for line in b[j1:j2]:
                     for l in line.split('\n'):
-                        if l != '':
-                            retval += '+' + l + '\n'
+                        retval += '+' + l + '\n'
 
     return retval
 


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]