Browse Source

Update tests accordingly

Matthew Wang 10 years ago
parent
commit
476efa1a1c
45 changed files with 171 additions and 171 deletions
  1. 12
    12
      tests/context/out.normal
  2. 9
    9
      tests/context/out.side-by-side
  3. 9
    9
      tests/context/out.w70
  4. 5
    5
      tests/crlf/out.normal
  5. 3
    3
      tests/crlf/out.side-by-side
  6. 3
    3
      tests/crlf/out.w70
  7. 4
    4
      tests/diff-ru-bin/out.normal
  8. 1
    1
      tests/diff-ru-bin/out.side-by-side
  9. 1
    1
      tests/diff-ru-bin/out.w70
  10. 4
    4
      tests/diff-ru/out.normal
  11. 2
    2
      tests/diff-ru/out.side-by-side
  12. 2
    2
      tests/diff-ru/out.w70
  13. 4
    4
      tests/git-bin/out.normal
  14. 3
    3
      tests/git-bin/out.side-by-side
  15. 3
    3
      tests/git-bin/out.w70
  16. 2
    2
      tests/git-log/out.normal
  17. 1
    1
      tests/git-log/out.side-by-side
  18. 1
    1
      tests/git-log/out.w70
  19. 1
    1
      tests/git-perm/out.normal
  20. 1
    1
      tests/git-perm/out.side-by-side
  21. 1
    1
      tests/git-perm/out.w70
  22. 6
    6
      tests/git/out.normal
  23. 1
    1
      tests/git/out.side-by-side
  24. 1
    1
      tests/git/out.w70
  25. 12
    12
      tests/hg-log/out.normal
  26. 9
    9
      tests/hg-log/out.side-by-side
  27. 9
    9
      tests/hg-log/out.w70
  28. 1
    1
      tests/latin1/out.normal
  29. 1
    1
      tests/regression.sh
  30. 3
    3
      tests/strange/out.normal
  31. 2
    2
      tests/strange/out.side-by-side
  32. 2
    2
      tests/strange/out.w70
  33. 11
    11
      tests/svn-log/out.normal
  34. 9
    9
      tests/svn-log/out.side-by-side
  35. 9
    9
      tests/svn-log/out.w70
  36. 1
    1
      tests/svn-merge/out.normal
  37. 1
    1
      tests/svn-merge/out.side-by-side
  38. 1
    1
      tests/svn-merge/out.w70
  39. 1
    1
      tests/svn-property/out.normal
  40. 1
    1
      tests/svn-property/out.side-by-side
  41. 1
    1
      tests/svn-property/out.w70
  42. 5
    5
      tests/svn/out.normal
  43. 3
    3
      tests/svn/out.side-by-side
  44. 3
    3
      tests/svn/out.w70
  45. 6
    6
      tests/test_cdiff.py

+ 12
- 12
tests/context/out.normal View File

3
 @@ -467,6 +467,13 @@
3
 @@ -467,6 +467,13 @@
4
          dom.unlink()
4
          dom.unlink()
5
          self.confirm(domstr == str.replace("\n", "\r\n"))
5
          self.confirm(domstr == str.replace("\n", "\r\n"))
6
-+
7
-+    def testPrettyTextNode(self):
8
-+        str = '<A>B</A>'
9
-+        dom = parseString(str)
10
-+        dom2 = parseString(dom.toprettyxml())
11
-+        self.confirm(dom.childNodes[0].childNodes[0].toxml()==
12
-+                     dom2.childNodes[0].childNodes[0].toxml())
6
++
7
++    def testPrettyTextNode(self):
8
++        str = '<A>B</A>'
9
++        dom = parseString(str)
10
++        dom2 = parseString(dom.toprettyxml())
11
++        self.confirm(dom.childNodes[0].childNodes[0].toxml()==
12
++                     dom2.childNodes[0].childNodes[0].toxml())
13
  
13
  
14
      def testProcessingInstruction(self):
14
      def testProcessingInstruction(self):
15
          dom = parseString('<e><?mypi \t\n data \t\n ?></e>')
15
          dom = parseString('<e><?mypi \t\n data \t\n ?></e>')
21
              writer.write("\"")
21
              writer.write("\"")
22
          if self.childNodes:
22
          if self.childNodes:
23
 -            writer.write(">%s"%(newl))
23
 -            writer.write(">%s"%(newl))
24
-+            writer.write(">")
25
-+            if self.childNodes[0].nodeType != Node.TEXT_NODE:     # Strict check
26
-+                writer.write(newl)
24
++            writer.write(">")
25
++            if self.childNodes[0].nodeType != Node.TEXT_NODE:     # Strict check
26
++                writer.write(newl)
27
              for node in self.childNodes:
27
              for node in self.childNodes:
28
                  node.writexml(writer,indent+addindent,addindent,newl)
28
                  node.writexml(writer,indent+addindent,addindent,newl)
29
              writer.write("%s</%s>%s" % (indent,self.tagName,newl))
29
              writer.write("%s</%s>%s" % (indent,self.tagName,newl))
32
  
32
  
33
      def writexml(self, writer, indent="", addindent="", newl=""):
33
      def writexml(self, writer, indent="", addindent="", newl=""):
34
 -        _write_data(writer, "%s%s%s"%(indent, self.data, newl))
34
 -        _write_data(writer, "%s%s%s"%(indent, self.data, newl))
35
-+        _write_data(writer, self.data)
35
++        _write_data(writer, self.data)
36
  
36
  
37
      # DOM Level 3 (WD 9 April 2002)
37
      # DOM Level 3 (WD 9 April 2002)
38
  
38
  
39
-
39
+

+ 9
- 9
tests/context/out.side-by-side View File

3
 @@ -467,6 +467,13 @@
3
 @@ -467,6 +467,13 @@
4
 467         dom.unlink()                                                             467         dom.unlink()
4
 467         dom.unlink()                                                             467         dom.unlink()
5
 468         self.confirm(domstr == str.replace("\n", "\r\n"))                        468         self.confirm(domstr == str.replace("\n", "\r\n"))
5
 468         self.confirm(domstr == str.replace("\n", "\r\n"))                        468         self.confirm(domstr == str.replace("\n", "\r\n"))
6
-                                                                                     469 
7
-                                                                                     470     def testPrettyTextNode(self):
8
-                                                                                     471         str = '<A>B</A>'
9
-                                                                                     472         dom = parseString(str)
10
-                                                                                     473         dom2 = parseString(dom.toprettyxml())
11
-                                                                                     474         self.confirm(dom.childNodes[0].childNodes[0].toxml()==
12
-                                                                                     475                      dom2.childNodes[0].childNodes[0].toxml())
6
+                                                                                     469 
7
+                                                                                     470     def testPrettyTextNode(self):
8
+                                                                                     471         str = '<A>B</A>'
9
+                                                                                     472         dom = parseString(str)
10
+                                                                                     473         dom2 = parseString(dom.toprettyxml())
11
+                                                                                     474         self.confirm(dom.childNodes[0].childNodes[0].toxml()==
12
+                                                                                     475                      dom2.childNodes[0].childNodes[0].toxml())
13
 469                                                                                  476 
13
 469                                                                                  476 
14
 470     def testProcessingInstruction(self):                                         477     def testProcessingInstruction(self):
14
 470     def testProcessingInstruction(self):                                         477     def testProcessingInstruction(self):
15
 471         dom = parseString('<e><?mypi \t\n data \t\n ?></e>')                     478         dom = parseString('<e><?mypi \t\n data \t\n ?></e>')
15
 471         dom = parseString('<e><?mypi \t\n data \t\n ?></e>')                     478         dom = parseString('<e><?mypi \t\n data \t\n ?></e>')
21
  837             writer.write("\"")                                                    837             writer.write("\"")
21
  837             writer.write("\"")                                                    837             writer.write("\"")
22
  838         if self.childNodes:                                                       838         if self.childNodes:
22
  838         if self.childNodes:                                                       838         if self.childNodes:
23
  839             writer.write(">%s"%(newl))                                            839             writer.write(">")
23
  839             writer.write(">%s"%(newl))                                            839             writer.write(">")
24
-                                                                                       840             if self.childNodes[0].nodeType != Node.TEXT_NODE:     # Strict check
25
-                                                                                       841                 writer.write(newl)
24
+                                                                                       840             if self.childNodes[0].nodeType != Node.TEXT_NODE:     # Strict check
25
+                                                                                       841                 writer.write(newl)
26
  840             for node in self.childNodes:                                          842             for node in self.childNodes:
26
  840             for node in self.childNodes:                                          842             for node in self.childNodes:
27
  841                 node.writexml(writer,indent+addindent,addindent,newl)             843                 node.writexml(writer,indent+addindent,addindent,newl)
27
  841                 node.writexml(writer,indent+addindent,addindent,newl)             843                 node.writexml(writer,indent+addindent,addindent,newl)
28
  842             writer.write("%s</%s>%s" % (indent,self.tagName,newl))                844             writer.write("%s</%s>%s" % (indent,self.tagName,newl))
28
  842             writer.write("%s</%s>%s" % (indent,self.tagName,newl))                844             writer.write("%s</%s>%s" % (indent,self.tagName,newl))

+ 9
- 9
tests/context/out.w70 View File

3
 @@ -467,6 +467,13 @@
3
 @@ -467,6 +467,13 @@
4
 467         dom.unlink()                                                   467         dom.unlink()
4
 467         dom.unlink()                                                   467         dom.unlink()
5
 468         self.confirm(domstr == str.replace("\n", "\r\n"))              468         self.confirm(domstr == str.replace("\n", "\r\n"))
5
 468         self.confirm(domstr == str.replace("\n", "\r\n"))              468         self.confirm(domstr == str.replace("\n", "\r\n"))
6
-                                                                           469 
7
-                                                                           470     def testPrettyTextNode(self):
8
-                                                                           471         str = '<A>B</A>'
9
-                                                                           472         dom = parseString(str)
10
-                                                                           473         dom2 = parseString(dom.toprettyxml())
11
-                                                                           474         self.confirm(dom.childNodes[0].childNodes[0].toxml()==
12
-                                                                           475                      dom2.childNodes[0].childNodes[0].toxml())
6
+                                                                           469 
7
+                                                                           470     def testPrettyTextNode(self):
8
+                                                                           471         str = '<A>B</A>'
9
+                                                                           472         dom = parseString(str)
10
+                                                                           473         dom2 = parseString(dom.toprettyxml())
11
+                                                                           474         self.confirm(dom.childNodes[0].childNodes[0].toxml()==
12
+                                                                           475                      dom2.childNodes[0].childNodes[0].toxml())
13
 469                                                                        476 
13
 469                                                                        476 
14
 470     def testProcessingInstruction(self):                               477     def testProcessingInstruction(self):
14
 470     def testProcessingInstruction(self):                               477     def testProcessingInstruction(self):
15
 471         dom = parseString('<e><?mypi \t\n data \t\n ?></e>')           478         dom = parseString('<e><?mypi \t\n data \t\n ?></e>')
15
 471         dom = parseString('<e><?mypi \t\n data \t\n ?></e>')           478         dom = parseString('<e><?mypi \t\n data \t\n ?></e>')
21
  837             writer.write("\"")                                          837             writer.write("\"")
21
  837             writer.write("\"")                                          837             writer.write("\"")
22
  838         if self.childNodes:                                             838         if self.childNodes:
22
  838         if self.childNodes:                                             838         if self.childNodes:
23
  839             writer.write(">%s"%(newl))                                  839             writer.write(">")
23
  839             writer.write(">%s"%(newl))                                  839             writer.write(">")
24
-                                                                             840             if self.childNodes[0].nodeType != Node.TEXT_NODE:     # S>
25
-                                                                             841                 writer.write(newl)
24
+                                                                             840             if self.childNodes[0].nodeType != Node.TEXT_NODE:     # S>
25
+                                                                             841                 writer.write(newl)
26
  840             for node in self.childNodes:                                842             for node in self.childNodes:
26
  840             for node in self.childNodes:                                842             for node in self.childNodes:
27
  841                 node.writexml(writer,indent+addindent,addindent,newl)   843                 node.writexml(writer,indent+addindent,addindent,newl)
27
  841                 node.writexml(writer,indent+addindent,addindent,newl)   843                 node.writexml(writer,indent+addindent,addindent,newl)
28
  842             writer.write("%s</%s>%s" % (indent,self.tagName,newl))      844             writer.write("%s</%s>%s" % (indent,self.tagName,newl))
28
  842             writer.write("%s</%s>%s" % (indent,self.tagName,newl))      844             writer.write("%s</%s>%s" % (indent,self.tagName,newl))

+ 5
- 5
tests/crlf/out.normal View File

15
  ## Usage of coderev.sh
15
  ## Usage of coderev.sh
16
  
16
  
17
 -Just type `./coderev.sh -h` to see the usage.
17
 -Just type `./coderev.sh -h` to see the usage.
18
-+Just type `./coderev.sh --help` to see the usage.
18
++Just type `./coderev.sh --help` to see the usage.
19
  
19
  
20
      Usage:
20
      Usage:
21
-+
21
++
22
          coderev.sh [-r revision] [-w width] [-o outdir] [-y] [-d name] \
22
          coderev.sh [-r revision] [-w width] [-o outdir] [-y] [-d name] \
23
                  [-F comment-file | -m 'comment...'] [file...]
23
                  [-F comment-file | -m 'comment...'] [file...]
24
  
24
  
26
                              specify column number where lines are broken and
26
                              specify column number where lines are broken and
27
                              wrapped for sdiff, default is no line wrapping
27
                              wrapped for sdiff, default is no line wrapping
28
      -y, --yes             do not prompt for overwriting
28
      -y, --yes             do not prompt for overwriting
29
-+
30
-+# EOF
31
-
29
++
30
++# EOF
31
+

+ 3
- 3
tests/crlf/out.side-by-side View File

17
  21 Just type `./coderev.sh -h` to see the usage.                                     20 Just type `./coderev.sh --help` to see the usage.
17
  21 Just type `./coderev.sh -h` to see the usage.                                     20 Just type `./coderev.sh --help` to see the usage.
18
  22                                                                                   21 
18
  22                                                                                   21 
19
  23     Usage:                                                                        22     Usage:
19
  23     Usage:                                                                        22     Usage:
20
-                                                                                      23 
20
+                                                                                      23 
21
  24         coderev.sh [-r revision] [-w width] [-o outdir] [-y] [-d name] \          24         coderev.sh [-r revision] [-w width] [-o outdir] [-y] [-d name] \
21
  24         coderev.sh [-r revision] [-w width] [-o outdir] [-y] [-d name] \          24         coderev.sh [-r revision] [-w width] [-o outdir] [-y] [-d name] \
22
  25                 [-F comment-file | -m 'comment...'] [file...]                     25                 [-F comment-file | -m 'comment...'] [file...]
22
  25                 [-F comment-file | -m 'comment...'] [file...]                     25                 [-F comment-file | -m 'comment...'] [file...]
23
  26                                                                                   26 
23
  26                                                                                   26 
25
 145                             specify column number where lines are broken and     145                             specify column number where lines are broken and
25
 145                             specify column number where lines are broken and     145                             specify column number where lines are broken and
26
 146                             wrapped for sdiff, default is no line wrapping       146                             wrapped for sdiff, default is no line wrapping
26
 146                             wrapped for sdiff, default is no line wrapping       146                             wrapped for sdiff, default is no line wrapping
27
 147     -y, --yes             do not prompt for overwriting                          147     -y, --yes             do not prompt for overwriting
27
 147     -y, --yes             do not prompt for overwriting                          147     -y, --yes             do not prompt for overwriting
28
-                                                                                     148 
29
-                                                                                     149 # EOF
28
+                                                                                     148 
29
+                                                                                     149 # EOF

+ 3
- 3
tests/crlf/out.w70 View File

17
  21 Just type `./coderev.sh -h` to see the usage.                           20 Just type `./coderev.sh --help` to see the usage.
17
  21 Just type `./coderev.sh -h` to see the usage.                           20 Just type `./coderev.sh --help` to see the usage.
18
  22                                                                         21 
18
  22                                                                         21 
19
  23     Usage:                                                              22     Usage:
19
  23     Usage:                                                              22     Usage:
20
-                                                                            23 
20
+                                                                            23 
21
  24         coderev.sh [-r revision] [-w width] [-o outdir] [-y] [-d name>  24         coderev.sh [-r revision] [-w width] [-o outdir] [-y] [-d name>
21
  24         coderev.sh [-r revision] [-w width] [-o outdir] [-y] [-d name>  24         coderev.sh [-r revision] [-w width] [-o outdir] [-y] [-d name>
22
  25                 [-F comment-file | -m 'comment...'] [file...]           25                 [-F comment-file | -m 'comment...'] [file...]
22
  25                 [-F comment-file | -m 'comment...'] [file...]           25                 [-F comment-file | -m 'comment...'] [file...]
23
  26                                                                         26 
23
  26                                                                         26 
25
 145                             specify column number where lines are bro> 145                             specify column number where lines are bro>
25
 145                             specify column number where lines are bro> 145                             specify column number where lines are bro>
26
 146                             wrapped for sdiff, default is no line wra> 146                             wrapped for sdiff, default is no line wra>
26
 146                             wrapped for sdiff, default is no line wra> 146                             wrapped for sdiff, default is no line wra>
27
 147     -y, --yes             do not prompt for overwriting                147     -y, --yes             do not prompt for overwriting
27
 147     -y, --yes             do not prompt for overwriting                147     -y, --yes             do not prompt for overwriting
28
-                                                                           148 
29
-                                                                           149 # EOF
28
+                                                                           148 
29
+                                                                           149 # EOF

+ 4
- 4
tests/diff-ru-bin/out.normal View File

3
 +++ b/README	2013-02-23 19:52:06.000000000 +0800
3
 +++ b/README	2013-02-23 19:52:06.000000000 +0800
4
 @@ -1,6 +1,6 @@
4
 @@ -1,6 +1,6 @@
5
 -# To generate expected output, chdir to a subdir and use following command, then
5
 -# To generate expected output, chdir to a subdir and use following command, then
6
-+# To generate expected output, cd to a subdir and use following command, then
6
++# To generate expected output, cd to a subdir and use following command, then
7
  # review with `less -R`
7
  # review with `less -R`
8
 -#
8
 -#
9
  ../../cdiff.py -c always < in.diff > out.normal
9
  ../../cdiff.py -c always < in.diff > out.normal
10
  ../../cdiff.py -c always -s < in.diff > out.side-by-side
10
  ../../cdiff.py -c always -s < in.diff > out.side-by-side
11
  ../../cdiff.py -c always -s < in.diff -w70 > out.w70
11
  ../../cdiff.py -c always -s < in.diff -w70 > out.w70
12
-+# EOF
12
++# EOF
13
 Binary files a/foo.pdf and b/foo.pdf differ
13
 Binary files a/foo.pdf and b/foo.pdf differ
14
 diff -ru a/foo.txt b/foo.txt
14
 diff -ru a/foo.txt b/foo.txt
15
 --- a/foo.txt	2013-02-23 19:55:03.000000000 +0800
15
 --- a/foo.txt	2013-02-23 19:55:03.000000000 +0800
16
 +++ b/foo.txt	2013-02-23 19:55:10.000000000 +0800
16
 +++ b/foo.txt	2013-02-23 19:55:10.000000000 +0800
17
 @@ -1,2 +1,2 @@
17
 @@ -1,2 +1,2 @@
18
 -Hello
18
 -Hello
19
-+hella
19
++hella
20
  world
20
  world
21
-
21
+

+ 1
- 1
tests/diff-ru-bin/out.side-by-side View File

8
 4 ../../cdiff.py -c always < in.diff > out.normal                                  3 ../../cdiff.py -c always < in.diff > out.normal
8
 4 ../../cdiff.py -c always < in.diff > out.normal                                  3 ../../cdiff.py -c always < in.diff > out.normal
9
 5 ../../cdiff.py -c always -s < in.diff > out.side-by-side                         4 ../../cdiff.py -c always -s < in.diff > out.side-by-side
9
 5 ../../cdiff.py -c always -s < in.diff > out.side-by-side                         4 ../../cdiff.py -c always -s < in.diff > out.side-by-side
10
 6 ../../cdiff.py -c always -s < in.diff -w70 > out.w70                             5 ../../cdiff.py -c always -s < in.diff -w70 > out.w70
10
 6 ../../cdiff.py -c always -s < in.diff -w70 > out.w70                             5 ../../cdiff.py -c always -s < in.diff -w70 > out.w70
11
-                                                                                   6 # EOF
11
+                                                                                   6 # EOF
12
 Binary files a/foo.pdf and b/foo.pdf differ
12
 Binary files a/foo.pdf and b/foo.pdf differ
13
 diff -ru a/foo.txt b/foo.txt
13
 diff -ru a/foo.txt b/foo.txt
14
 --- a/foo.txt	2013-02-23 19:55:03.000000000 +0800
14
 --- a/foo.txt	2013-02-23 19:55:03.000000000 +0800

+ 1
- 1
tests/diff-ru-bin/out.w70 View File

8
 4 ../../cdiff.py -c always < in.diff > out.normal                        3 ../../cdiff.py -c always < in.diff > out.normal
8
 4 ../../cdiff.py -c always < in.diff > out.normal                        3 ../../cdiff.py -c always < in.diff > out.normal
9
 5 ../../cdiff.py -c always -s < in.diff > out.side-by-side               4 ../../cdiff.py -c always -s < in.diff > out.side-by-side
9
 5 ../../cdiff.py -c always -s < in.diff > out.side-by-side               4 ../../cdiff.py -c always -s < in.diff > out.side-by-side
10
 6 ../../cdiff.py -c always -s < in.diff -w70 > out.w70                   5 ../../cdiff.py -c always -s < in.diff -w70 > out.w70
10
 6 ../../cdiff.py -c always -s < in.diff -w70 > out.w70                   5 ../../cdiff.py -c always -s < in.diff -w70 > out.w70
11
-                                                                         6 # EOF
11
+                                                                         6 # EOF
12
 Binary files a/foo.pdf and b/foo.pdf differ
12
 Binary files a/foo.pdf and b/foo.pdf differ
13
 diff -ru a/foo.txt b/foo.txt
13
 diff -ru a/foo.txt b/foo.txt
14
 --- a/foo.txt	2013-02-23 19:55:03.000000000 +0800
14
 --- a/foo.txt	2013-02-23 19:55:03.000000000 +0800

+ 4
- 4
tests/diff-ru/out.normal View File

3
 +++ b/README	2013-02-22 20:27:51.000000000 +0800
3
 +++ b/README	2013-02-22 20:27:51.000000000 +0800
4
 @@ -1,6 +1,6 @@
4
 @@ -1,6 +1,6 @@
5
 -# To generate expected output, chdir to a subdir and use following command, then
5
 -# To generate expected output, chdir to a subdir and use following command, then
6
-+# To generate expected output, cd to a subdir and use following command, then
6
++# To generate expected output, cd to a subdir and use following command, then
7
  # review with `less -R`
7
  # review with `less -R`
8
 -#
8
 -#
9
  ../../cdiff.py -c always in.diff > out.normal 
9
  ../../cdiff.py -c always in.diff > out.normal 
10
  ../../cdiff.py -c always -s in.diff > out.side-by-side
10
  ../../cdiff.py -c always -s in.diff > out.side-by-side
11
  ../../cdiff.py -c always -s in.diff -w70 > out.w70
11
  ../../cdiff.py -c always -s in.diff -w70 > out.w70
12
-+# EOF
12
++# EOF
13
 Only in a: a1
13
 Only in a: a1
14
 Only in b: b1
14
 Only in b: b1
15
 diff -ru a/common/foo.txt b/common/foo.txt
15
 diff -ru a/common/foo.txt b/common/foo.txt
17
 +++ b/common/foo.txt	2013-02-22 20:30:18.000000000 +0800
17
 +++ b/common/foo.txt	2013-02-22 20:30:18.000000000 +0800
18
 @@ -1 +1 @@
18
 @@ -1 +1 @@
19
 -Hello
19
 -Hello
20
-+world
20
++world
21
 Only in b: date.txt
21
 Only in b: date.txt
22
 Only in a: time.txt
22
 Only in a: time.txt
23
-
23
+

+ 2
- 2
tests/diff-ru/out.side-by-side View File

8
 4 ../../cdiff.py -c always in.diff > out.normal                                    3 ../../cdiff.py -c always in.diff > out.normal 
8
 4 ../../cdiff.py -c always in.diff > out.normal                                    3 ../../cdiff.py -c always in.diff > out.normal 
9
 5 ../../cdiff.py -c always -s in.diff > out.side-by-side                           4 ../../cdiff.py -c always -s in.diff > out.side-by-side
9
 5 ../../cdiff.py -c always -s in.diff > out.side-by-side                           4 ../../cdiff.py -c always -s in.diff > out.side-by-side
10
 6 ../../cdiff.py -c always -s in.diff -w70 > out.w70                               5 ../../cdiff.py -c always -s in.diff -w70 > out.w70
10
 6 ../../cdiff.py -c always -s in.diff -w70 > out.w70                               5 ../../cdiff.py -c always -s in.diff -w70 > out.w70
11
-                                                                                   6 # EOF
11
+                                                                                   6 # EOF
12
 Only in a: a1
12
 Only in a: a1
13
 Only in b: b1
13
 Only in b: b1
14
 diff -ru a/common/foo.txt b/common/foo.txt
14
 diff -ru a/common/foo.txt b/common/foo.txt
18
 1 Hello                                                                            1 world
18
 1 Hello                                                                            1 world
19
 Only in b: date.txt
19
 Only in b: date.txt
20
 Only in a: time.txt
20
 Only in a: time.txt
21
-
21
+

+ 2
- 2
tests/diff-ru/out.w70 View File

8
 4 ../../cdiff.py -c always in.diff > out.normal                          3 ../../cdiff.py -c always in.diff > out.normal 
8
 4 ../../cdiff.py -c always in.diff > out.normal                          3 ../../cdiff.py -c always in.diff > out.normal 
9
 5 ../../cdiff.py -c always -s in.diff > out.side-by-side                 4 ../../cdiff.py -c always -s in.diff > out.side-by-side
9
 5 ../../cdiff.py -c always -s in.diff > out.side-by-side                 4 ../../cdiff.py -c always -s in.diff > out.side-by-side
10
 6 ../../cdiff.py -c always -s in.diff -w70 > out.w70                     5 ../../cdiff.py -c always -s in.diff -w70 > out.w70
10
 6 ../../cdiff.py -c always -s in.diff -w70 > out.w70                     5 ../../cdiff.py -c always -s in.diff -w70 > out.w70
11
-                                                                         6 # EOF
11
+                                                                         6 # EOF
12
 Only in a: a1
12
 Only in a: a1
13
 Only in b: b1
13
 Only in b: b1
14
 diff -ru a/common/foo.txt b/common/foo.txt
14
 diff -ru a/common/foo.txt b/common/foo.txt
18
 1 Hello                                                                  1 world
18
 1 Hello                                                                  1 world
19
 Only in b: date.txt
19
 Only in b: date.txt
20
 Only in a: time.txt
20
 Only in a: time.txt
21
-
21
+

+ 4
- 4
tests/git-bin/out.normal View File

6
  OUTPUT=${INPUT%.html}.pdf
6
  OUTPUT=${INPUT%.html}.pdf
7
  
7
  
8
  wkhtmltopdf --page-size A4 $INPUT $OUTPUT  # very very long comments ends here
8
  wkhtmltopdf --page-size A4 $INPUT $OUTPUT  # very very long comments ends here
9
-+
10
-+# EOF
9
++
10
++# EOF
11
 diff --git a/example.pdf b/example.pdf
11
 diff --git a/example.pdf b/example.pdf
12
 index 1eacfd8..3696851 100644
12
 index 1eacfd8..3696851 100644
13
 Binary files a/example.pdf and b/example.pdf differ
13
 Binary files a/example.pdf and b/example.pdf differ
17
 +++ b/foo.html
17
 +++ b/foo.html
18
 @@ -1,4 +1,4 @@
18
 @@ -1,4 +1,4 @@
19
 -<!doctype html>
19
 -<!doctype html>
20
-+<!DOCTYPE html>
20
++<!DOCTYPE html>
21
  <html>
21
  <html>
22
  
22
  
23
  <head>
23
  <head>
24
 diff --git a/foo.pdf b/foo.pdf
24
 diff --git a/foo.pdf b/foo.pdf
25
 index 0e90017..3c3b90d 100644
25
 index 0e90017..3c3b90d 100644
26
 Binary files a/foo.pdf and b/foo.pdf differ
26
 Binary files a/foo.pdf and b/foo.pdf differ
27
-
27
+

+ 3
- 3
tests/git-bin/out.side-by-side View File

6
 13 OUTPUT=${INPUT%.html}.pdf                                                        13 OUTPUT=${INPUT%.html}.pdf
6
 13 OUTPUT=${INPUT%.html}.pdf                                                        13 OUTPUT=${INPUT%.html}.pdf
7
 14                                                                                  14 
7
 14                                                                                  14 
8
 15 wkhtmltopdf --page-size A4 $INPUT $OUTPUT  # very very long comments ends here   15 wkhtmltopdf --page-size A4 $INPUT $OUTPUT  # very very long comments ends here
8
 15 wkhtmltopdf --page-size A4 $INPUT $OUTPUT  # very very long comments ends here   15 wkhtmltopdf --page-size A4 $INPUT $OUTPUT  # very very long comments ends here
9
-                                                                                    16 
10
-                                                                                    17 # EOF
9
+                                                                                    16 
10
+                                                                                    17 # EOF
11
 diff --git a/example.pdf b/example.pdf
11
 diff --git a/example.pdf b/example.pdf
12
 index 1eacfd8..3696851 100644
12
 index 1eacfd8..3696851 100644
13
 Binary files a/example.pdf and b/example.pdf differ
13
 Binary files a/example.pdf and b/example.pdf differ
23
 diff --git a/foo.pdf b/foo.pdf
23
 diff --git a/foo.pdf b/foo.pdf
24
 index 0e90017..3c3b90d 100644
24
 index 0e90017..3c3b90d 100644
25
 Binary files a/foo.pdf and b/foo.pdf differ
25
 Binary files a/foo.pdf and b/foo.pdf differ
26
-
26
+

+ 3
- 3
tests/git-bin/out.w70 View File

6
 13 OUTPUT=${INPUT%.html}.pdf                                              13 OUTPUT=${INPUT%.html}.pdf
6
 13 OUTPUT=${INPUT%.html}.pdf                                              13 OUTPUT=${INPUT%.html}.pdf
7
 14                                                                        14 
7
 14                                                                        14 
8
 15 wkhtmltopdf --page-size A4 $INPUT $OUTPUT  # very very long comments > 15 wkhtmltopdf --page-size A4 $INPUT $OUTPUT  # very very long comments >
8
 15 wkhtmltopdf --page-size A4 $INPUT $OUTPUT  # very very long comments > 15 wkhtmltopdf --page-size A4 $INPUT $OUTPUT  # very very long comments >
9
-                                                                          16 
10
-                                                                          17 # EOF
9
+                                                                          16 
10
+                                                                          17 # EOF
11
 diff --git a/example.pdf b/example.pdf
11
 diff --git a/example.pdf b/example.pdf
12
 index 1eacfd8..3696851 100644
12
 index 1eacfd8..3696851 100644
13
 Binary files a/example.pdf and b/example.pdf differ
13
 Binary files a/example.pdf and b/example.pdf differ
23
 diff --git a/foo.pdf b/foo.pdf
23
 diff --git a/foo.pdf b/foo.pdf
24
 index 0e90017..3c3b90d 100644
24
 index 0e90017..3c3b90d 100644
25
 Binary files a/foo.pdf and b/foo.pdf differ
25
 Binary files a/foo.pdf and b/foo.pdf differ
26
-
26
+

+ 2
- 2
tests/git-log/out.normal View File

31
      """Main program.
31
      """Main program.
32
  
32
  
33
      Returns a suggested exit status (0, 1, 2).
33
      Returns a suggested exit status (0, 1, 2).
34
-+
34
++
35
      """
35
      """
36
      # Set up option parser
36
      # Set up option parser
37
      parser = optparse.OptionParser(usage="modernize [options] file|dir ...")
37
      parser = optparse.OptionParser(usage="modernize [options] file|dir ...")
38
-
38
+

+ 1
- 1
tests/git-log/out.side-by-side View File

31
 14     """Main program.                                                             14     """Main program.
31
 14     """Main program.                                                             14     """Main program.
32
 15                                                                                  15 
32
 15                                                                                  15 
33
 16     Returns a suggested exit status (0, 1, 2).                                   16     Returns a suggested exit status (0, 1, 2).
33
 16     Returns a suggested exit status (0, 1, 2).                                   16     Returns a suggested exit status (0, 1, 2).
34
-                                                                                    17 
34
+                                                                                    17 
35
 17     """                                                                          18     """
35
 17     """                                                                          18     """
36
 18     # Set up option parser                                                       19     # Set up option parser
36
 18     # Set up option parser                                                       19     # Set up option parser
37
 19     parser = optparse.OptionParser(usage="modernize [options] file|dir ...")     20     parser = optparse.OptionParser(usage="modernize [options] file|dir ...")
37
 19     parser = optparse.OptionParser(usage="modernize [options] file|dir ...")     20     parser = optparse.OptionParser(usage="modernize [options] file|dir ...")

+ 1
- 1
tests/git-log/out.w70 View File

31
 14     """Main program.                                                   14     """Main program.
31
 14     """Main program.                                                   14     """Main program.
32
 15                                                                        15 
32
 15                                                                        15 
33
 16     Returns a suggested exit status (0, 1, 2).                         16     Returns a suggested exit status (0, 1, 2).
33
 16     Returns a suggested exit status (0, 1, 2).                         16     Returns a suggested exit status (0, 1, 2).
34
-                                                                          17 
34
+                                                                          17 
35
 17     """                                                                18     """
35
 17     """                                                                18     """
36
 18     # Set up option parser                                             19     # Set up option parser
36
 18     # Set up option parser                                             19     # Set up option parser
37
 19     parser = optparse.OptionParser(usage="modernize [options] file|di> 20     parser = optparse.OptionParser(usage="modernize [options] file|di>
37
 19     parser = optparse.OptionParser(usage="modernize [options] file|di> 20     parser = optparse.OptionParser(usage="modernize [options] file|di>

+ 1
- 1
tests/git-perm/out.normal View File

4
 diff --git a/cdiff.py b/cdiff.py
4
 diff --git a/cdiff.py b/cdiff.py
5
 old mode 100755
5
 old mode 100755
6
 new mode 100644
6
 new mode 100644
7
-
7
+

+ 1
- 1
tests/git-perm/out.side-by-side View File

4
 diff --git a/cdiff.py b/cdiff.py
4
 diff --git a/cdiff.py b/cdiff.py
5
 old mode 100755
5
 old mode 100755
6
 new mode 100644
6
 new mode 100644
7
-
7
+

+ 1
- 1
tests/git-perm/out.w70 View File

4
 diff --git a/cdiff.py b/cdiff.py
4
 diff --git a/cdiff.py b/cdiff.py
5
 old mode 100755
5
 old mode 100755
6
 new mode 100644
6
 new mode 100644
7
-
7
+

+ 6
- 6
tests/git/out.normal View File

13
  
13
  
14
      def markup_side_by_side(self, width):
14
      def markup_side_by_side(self, width):
15
 -        """width of 0 means infinite width, None means auto detect. Returns a
15
 -        """width of 0 means infinite width, None means auto detect. Returns a
16
-+        """Returns a generator"""
16
++        """Returns a generator"""
17
 -        generator
17
 -        generator
18
 -        """
18
 -        """
19
          def _normalize(line):
19
          def _normalize(line):
24
  
24
  
25
          # Setup line width and number width
25
          # Setup line width and number width
26
 -        if not width: width = 80
26
 -        if not width: width = 80
27
-+        if width <= 0:
28
-+            width = 80
27
++        if width <= 0:
28
++            width = 80
29
          (start, offset) = self._hunks[-1].get_old_addr()
29
          (start, offset) = self._hunks[-1].get_old_addr()
30
          max1 = start + offset - 1
30
          max1 = start + offset - 1
31
          (start, offset) = self._hunks[-1].get_new_addr()
31
          (start, offset) = self._hunks[-1].get_new_addr()
34
      parser.add_option('-s', '--side-by-side', action='store_true',
34
      parser.add_option('-s', '--side-by-side', action='store_true',
35
              help=('show in side-by-side mode'))
35
              help=('show in side-by-side mode'))
36
 -    parser.add_option('-w', '--width', type='int', default=None,
36
 -    parser.add_option('-w', '--width', type='int', default=None,
37
-+    parser.add_option('-w', '--width', type='int', default=80,
37
++    parser.add_option('-w', '--width', type='int', default=80,
38
 -            help='set line width (side-by-side mode only)')
38
 -            help='set line width (side-by-side mode only)')
39
-+            help='set line width (side-by-side mode only), default is 80')
39
++            help='set line width (side-by-side mode only), default is 80')
40
      opts, args = parser.parse_args()
40
      opts, args = parser.parse_args()
41
 -
41
 -
42
 -    if opts.width and opts.width < 0:
42
 -    if opts.width and opts.width < 0:
45
      if len(args) >= 1:
45
      if len(args) >= 1:
46
          diff_hdl = open(args[0], 'r')
46
          diff_hdl = open(args[0], 'r')
47
      elif sys.stdin.isatty():
47
      elif sys.stdin.isatty():
48
-
48
+

+ 1
- 1
tests/git/out.side-by-side View File

23
 148                                                                                  146 
23
 148                                                                                  146 
24
 149         # Setup line width and number width                                      147         # Setup line width and number width
24
 149         # Setup line width and number width                                      147         # Setup line width and number width
25
 150         if not width: width = 80                                                 148         if width <= 0:
25
 150         if not width: width = 80                                                 148         if width <= 0:
26
-                                                                                     149             width = 80
26
+                                                                                     149             width = 80
27
 151         (start, offset) = self._hunks[-1].get_old_addr()                         150         (start, offset) = self._hunks[-1].get_old_addr()
27
 151         (start, offset) = self._hunks[-1].get_old_addr()                         150         (start, offset) = self._hunks[-1].get_old_addr()
28
 152         max1 = start + offset - 1                                                151         max1 = start + offset - 1
28
 152         max1 = start + offset - 1                                                151         max1 = start + offset - 1
29
 153         (start, offset) = self._hunks[-1].get_new_addr()                         152         (start, offset) = self._hunks[-1].get_new_addr()
29
 153         (start, offset) = self._hunks[-1].get_new_addr()                         152         (start, offset) = self._hunks[-1].get_new_addr()

+ 1
- 1
tests/git/out.w70 View File

23
 148                                                                        146 
23
 148                                                                        146 
24
 149         # Setup line width and number width                            147         # Setup line width and number width
24
 149         # Setup line width and number width                            147         # Setup line width and number width
25
 150         if not width: width = 80                                       148         if width <= 0:
25
 150         if not width: width = 80                                       148         if width <= 0:
26
-                                                                           149             width = 80
26
+                                                                           149             width = 80
27
 151         (start, offset) = self._hunks[-1].get_old_addr()               150         (start, offset) = self._hunks[-1].get_old_addr()
27
 151         (start, offset) = self._hunks[-1].get_old_addr()               150         (start, offset) = self._hunks[-1].get_old_addr()
28
 152         max1 = start + offset - 1                                      151         max1 = start + offset - 1
28
 152         max1 = start + offset - 1                                      151         max1 = start + offset - 1
29
 153         (start, offset) = self._hunks[-1].get_new_addr()               152         (start, offset) = self._hunks[-1].get_new_addr()
29
 153         (start, offset) = self._hunks[-1].get_new_addr()               152         (start, offset) = self._hunks[-1].get_new_addr()

+ 12
- 12
tests/hg-log/out.normal View File

17
 @@ -467,6 +467,13 @@
17
 @@ -467,6 +467,13 @@
18
          dom.unlink()
18
          dom.unlink()
19
          self.confirm(domstr == str.replace("\n", "\r\n"))
19
          self.confirm(domstr == str.replace("\n", "\r\n"))
20
-+
21
-+    def testPrettyTextNode(self):
22
-+        str = '<A>B</A>'
23
-+        dom = parseString(str)
24
-+        dom2 = parseString(dom.toprettyxml())
25
-+        self.confirm(dom.childNodes[0].childNodes[0].toxml()==
26
-+                     dom2.childNodes[0].childNodes[0].toxml())
20
++
21
++    def testPrettyTextNode(self):
22
++        str = '<A>B</A>'
23
++        dom = parseString(str)
24
++        dom2 = parseString(dom.toprettyxml())
25
++        self.confirm(dom.childNodes[0].childNodes[0].toxml()==
26
++                     dom2.childNodes[0].childNodes[0].toxml())
27
  
27
  
28
      def testProcessingInstruction(self):
28
      def testProcessingInstruction(self):
29
          dom = parseString('<e><?mypi \t\n data \t\n ?></e>')
29
          dom = parseString('<e><?mypi \t\n data \t\n ?></e>')
36
              writer.write("\"")
36
              writer.write("\"")
37
          if self.childNodes:
37
          if self.childNodes:
38
 -            writer.write(">%s"%(newl))
38
 -            writer.write(">%s"%(newl))
39
-+            writer.write(">")
40
-+            if self.childNodes[0].nodeType != Node.TEXT_NODE:
41
-+                writer.write(newl)
39
++            writer.write(">")
40
++            if self.childNodes[0].nodeType != Node.TEXT_NODE:
41
++                writer.write(newl)
42
              for node in self.childNodes:
42
              for node in self.childNodes:
43
                  node.writexml(writer,indent+addindent,addindent,newl)
43
                  node.writexml(writer,indent+addindent,addindent,newl)
44
              writer.write("%s</%s>%s" % (indent,self.tagName,newl))
44
              writer.write("%s</%s>%s" % (indent,self.tagName,newl))
47
  
47
  
48
      def writexml(self, writer, indent="", addindent="", newl=""):
48
      def writexml(self, writer, indent="", addindent="", newl=""):
49
 -        _write_data(writer, "%s%s%s"%(indent, self.data, newl))
49
 -        _write_data(writer, "%s%s%s"%(indent, self.data, newl))
50
-+        _write_data(writer, self.data)
50
++        _write_data(writer, self.data)
51
  
51
  
52
      # DOM Level 3 (WD 9 April 2002)
52
      # DOM Level 3 (WD 9 April 2002)
53
  
53
  
54
-
54
+

+ 9
- 9
tests/hg-log/out.side-by-side View File

17
 @@ -467,6 +467,13 @@
17
 @@ -467,6 +467,13 @@
18
 467         dom.unlink()                                                             467         dom.unlink()
18
 467         dom.unlink()                                                             467         dom.unlink()
19
 468         self.confirm(domstr == str.replace("\n", "\r\n"))                        468         self.confirm(domstr == str.replace("\n", "\r\n"))
19
 468         self.confirm(domstr == str.replace("\n", "\r\n"))                        468         self.confirm(domstr == str.replace("\n", "\r\n"))
20
-                                                                                     469 
21
-                                                                                     470     def testPrettyTextNode(self):
22
-                                                                                     471         str = '<A>B</A>'
23
-                                                                                     472         dom = parseString(str)
24
-                                                                                     473         dom2 = parseString(dom.toprettyxml())
25
-                                                                                     474         self.confirm(dom.childNodes[0].childNodes[0].toxml()==
26
-                                                                                     475                      dom2.childNodes[0].childNodes[0].toxml())
20
+                                                                                     469 
21
+                                                                                     470     def testPrettyTextNode(self):
22
+                                                                                     471         str = '<A>B</A>'
23
+                                                                                     472         dom = parseString(str)
24
+                                                                                     473         dom2 = parseString(dom.toprettyxml())
25
+                                                                                     474         self.confirm(dom.childNodes[0].childNodes[0].toxml()==
26
+                                                                                     475                      dom2.childNodes[0].childNodes[0].toxml())
27
 469                                                                                  476 
27
 469                                                                                  476 
28
 470     def testProcessingInstruction(self):                                         477     def testProcessingInstruction(self):
28
 470     def testProcessingInstruction(self):                                         477     def testProcessingInstruction(self):
29
 471         dom = parseString('<e><?mypi \t\n data \t\n ?></e>')                     478         dom = parseString('<e><?mypi \t\n data \t\n ?></e>')
29
 471         dom = parseString('<e><?mypi \t\n data \t\n ?></e>')                     478         dom = parseString('<e><?mypi \t\n data \t\n ?></e>')
36
  837             writer.write("\"")                                                    837             writer.write("\"")
36
  837             writer.write("\"")                                                    837             writer.write("\"")
37
  838         if self.childNodes:                                                       838         if self.childNodes:
37
  838         if self.childNodes:                                                       838         if self.childNodes:
38
  839             writer.write(">%s"%(newl))                                            839             writer.write(">")
38
  839             writer.write(">%s"%(newl))                                            839             writer.write(">")
39
-                                                                                       840             if self.childNodes[0].nodeType != Node.TEXT_NODE:
40
-                                                                                       841                 writer.write(newl)
39
+                                                                                       840             if self.childNodes[0].nodeType != Node.TEXT_NODE:
40
+                                                                                       841                 writer.write(newl)
41
  840             for node in self.childNodes:                                          842             for node in self.childNodes:
41
  840             for node in self.childNodes:                                          842             for node in self.childNodes:
42
  841                 node.writexml(writer,indent+addindent,addindent,newl)             843                 node.writexml(writer,indent+addindent,addindent,newl)
42
  841                 node.writexml(writer,indent+addindent,addindent,newl)             843                 node.writexml(writer,indent+addindent,addindent,newl)
43
  842             writer.write("%s</%s>%s" % (indent,self.tagName,newl))                844             writer.write("%s</%s>%s" % (indent,self.tagName,newl))
43
  842             writer.write("%s</%s>%s" % (indent,self.tagName,newl))                844             writer.write("%s</%s>%s" % (indent,self.tagName,newl))

+ 9
- 9
tests/hg-log/out.w70 View File

17
 @@ -467,6 +467,13 @@
17
 @@ -467,6 +467,13 @@
18
 467         dom.unlink()                                                   467         dom.unlink()
18
 467         dom.unlink()                                                   467         dom.unlink()
19
 468         self.confirm(domstr == str.replace("\n", "\r\n"))              468         self.confirm(domstr == str.replace("\n", "\r\n"))
19
 468         self.confirm(domstr == str.replace("\n", "\r\n"))              468         self.confirm(domstr == str.replace("\n", "\r\n"))
20
-                                                                           469 
21
-                                                                           470     def testPrettyTextNode(self):
22
-                                                                           471         str = '<A>B</A>'
23
-                                                                           472         dom = parseString(str)
24
-                                                                           473         dom2 = parseString(dom.toprettyxml())
25
-                                                                           474         self.confirm(dom.childNodes[0].childNodes[0].toxml()==
26
-                                                                           475                      dom2.childNodes[0].childNodes[0].toxml())
20
+                                                                           469 
21
+                                                                           470     def testPrettyTextNode(self):
22
+                                                                           471         str = '<A>B</A>'
23
+                                                                           472         dom = parseString(str)
24
+                                                                           473         dom2 = parseString(dom.toprettyxml())
25
+                                                                           474         self.confirm(dom.childNodes[0].childNodes[0].toxml()==
26
+                                                                           475                      dom2.childNodes[0].childNodes[0].toxml())
27
 469                                                                        476 
27
 469                                                                        476 
28
 470     def testProcessingInstruction(self):                               477     def testProcessingInstruction(self):
28
 470     def testProcessingInstruction(self):                               477     def testProcessingInstruction(self):
29
 471         dom = parseString('<e><?mypi \t\n data \t\n ?></e>')           478         dom = parseString('<e><?mypi \t\n data \t\n ?></e>')
29
 471         dom = parseString('<e><?mypi \t\n data \t\n ?></e>')           478         dom = parseString('<e><?mypi \t\n data \t\n ?></e>')
36
  837             writer.write("\"")                                          837             writer.write("\"")
36
  837             writer.write("\"")                                          837             writer.write("\"")
37
  838         if self.childNodes:                                             838         if self.childNodes:
37
  838         if self.childNodes:                                             838         if self.childNodes:
38
  839             writer.write(">%s"%(newl))                                  839             writer.write(">")
38
  839             writer.write(">%s"%(newl))                                  839             writer.write(">")
39
-                                                                             840             if self.childNodes[0].nodeType != Node.TEXT_NODE:
40
-                                                                             841                 writer.write(newl)
39
+                                                                             840             if self.childNodes[0].nodeType != Node.TEXT_NODE:
40
+                                                                             841                 writer.write(newl)
41
  840             for node in self.childNodes:                                842             for node in self.childNodes:
41
  840             for node in self.childNodes:                                842             for node in self.childNodes:
42
  841                 node.writexml(writer,indent+addindent,addindent,newl)   843                 node.writexml(writer,indent+addindent,addindent,newl)
42
  841                 node.writexml(writer,indent+addindent,addindent,newl)   843                 node.writexml(writer,indent+addindent,addindent,newl)
43
  842             writer.write("%s</%s>%s" % (indent,self.tagName,newl))      844             writer.write("%s</%s>%s" % (indent,self.tagName,newl))
43
  842             writer.write("%s</%s>%s" % (indent,self.tagName,newl))      844             writer.write("%s</%s>%s" % (indent,self.tagName,newl))

+ 1
- 1
tests/latin1/out.normal View File

7
  int latin1()
7
  int latin1()
8
  {
8
  {
9
  	static int x;
9
  	static int x;
10
-
10
+

+ 1
- 1
tests/regression.sh View File

11
 function pass()
11
 function pass()
12
 {
12
 {
13
     if [[ -t 1 ]]; then
13
     if [[ -t 1 ]]; then
14
-        echo -e "\x1b[01;32mPASS\x1b[0m" "$*"
14
+        echo -e "\x1b[032mPASS\x1b[0m" "$*"
15
     else
15
     else
16
         echo "PASS" "$*"
16
         echo "PASS" "$*"
17
     fi
17
     fi

+ 3
- 3
tests/strange/out.normal View File

10
 --- /dev/null
10
 --- /dev/null
11
 +++ b/.gitignore
11
 +++ b/.gitignore
12
 @@ -0,0 +1 @@
12
 @@ -0,0 +1 @@
13
-+*.pyc
13
++*.pyc
14
 diff --git a/README b/README
14
 diff --git a/README b/README
15
 index 7e70850..b5eb369 100644
15
 index 7e70850..b5eb369 100644
16
 --- a/README
16
 --- a/README
17
 +++ b/README
17
 +++ b/README
18
 @@ -1 +1,2 @@
18
 @@ -1 +1,2 @@
19
  Sun Feb  3 13:57:05 CST 2013
19
  Sun Feb  3 13:57:05 CST 2013
20
-+Sun Feb  3 13:57:15 CST 2013
21
-
20
++Sun Feb  3 13:57:15 CST 2013
21
+

+ 2
- 2
tests/strange/out.side-by-side View File

10
 --- /dev/null
10
 --- /dev/null
11
 +++ b/.gitignore
11
 +++ b/.gitignore
12
 @@ -0,0 +1 @@
12
 @@ -0,0 +1 @@
13
-                                                                                     1 *.pyc
13
+                                                                                     1 *.pyc
14
 diff --git a/README b/README
14
 diff --git a/README b/README
15
 index 7e70850..b5eb369 100644
15
 index 7e70850..b5eb369 100644
16
 --- a/README
16
 --- a/README
17
 +++ b/README
17
 +++ b/README
18
 @@ -1 +1,2 @@
18
 @@ -1 +1,2 @@
19
 1 Sun Feb  3 13:57:05 CST 2013                                                     1 Sun Feb  3 13:57:05 CST 2013
19
 1 Sun Feb  3 13:57:05 CST 2013                                                     1 Sun Feb  3 13:57:05 CST 2013
20
-                                                                                   2 Sun Feb  3 13:57:15 CST 2013
20
+                                                                                   2 Sun Feb  3 13:57:15 CST 2013

+ 2
- 2
tests/strange/out.w70 View File

10
 --- /dev/null
10
 --- /dev/null
11
 +++ b/.gitignore
11
 +++ b/.gitignore
12
 @@ -0,0 +1 @@
12
 @@ -0,0 +1 @@
13
-                                                                           1 *.pyc
13
+                                                                           1 *.pyc
14
 diff --git a/README b/README
14
 diff --git a/README b/README
15
 index 7e70850..b5eb369 100644
15
 index 7e70850..b5eb369 100644
16
 --- a/README
16
 --- a/README
17
 +++ b/README
17
 +++ b/README
18
 @@ -1 +1,2 @@
18
 @@ -1 +1,2 @@
19
 1 Sun Feb  3 13:57:05 CST 2013                                           1 Sun Feb  3 13:57:05 CST 2013
19
 1 Sun Feb  3 13:57:05 CST 2013                                           1 Sun Feb  3 13:57:05 CST 2013
20
-                                                                         2 Sun Feb  3 13:57:15 CST 2013
20
+                                                                         2 Sun Feb  3 13:57:15 CST 2013

+ 11
- 11
tests/svn-log/out.normal View File

10
 +++ src/share/example.sh	(revision 1235)
10
 +++ src/share/example.sh	(revision 1235)
11
 @@ -1,3 +1,3 @@
11
 @@ -1,3 +1,3 @@
12
 -#!/bin/sh
12
 -#!/bin/sh
13
-+#!/bin/bash
13
++#!/bin/bash
14
  #
14
  #
15
  # Test program, also try run me as yroot (sudo ./example.sh)
15
  # Test program, also try run me as yroot (sudo ./example.sh)
16
 
16
 
25
 --- ChangeLog	(revision 1233)
25
 --- ChangeLog	(revision 1233)
26
 +++ ChangeLog	(revision 1234)
26
 +++ ChangeLog	(revision 1234)
27
 @@ -1,3 +1,6 @@
27
 @@ -1,3 +1,6 @@
28
-+Version 0.0.4
29
-+    * Add prototype of perl module
30
-+
28
++Version 0.0.4
29
++    * Add prototype of perl module
30
++
31
  Version 0.0.3
31
  Version 0.0.3
32
      * Implement '-d' option
32
      * Implement '-d' option
33
      * Add configfile to set global debug flag
33
      * Add configfile to set global debug flag
36
 --- src/share/example.sh	(revision 0)
36
 --- src/share/example.sh	(revision 0)
37
 +++ src/share/example.sh	(revision 1234)
37
 +++ src/share/example.sh	(revision 1234)
38
 @@ -0,0 +1,4 @@
38
 @@ -0,0 +1,4 @@
39
-+#!/bin/sh
40
-+#
41
-+# Test program, also try run me as yroot (sudo ./example.sh)
42
-+#
39
++#!/bin/sh
40
++#
41
++# Test program, also try run me as yroot (sudo ./example.sh)
42
++#
43
 
43
 
44
 Property changes on: src/share/example.sh
44
 Property changes on: src/share/example.sh
45
 ___________________________________________________________________
45
 ___________________________________________________________________
46
 Added: svn:executable
46
 Added: svn:executable
47
 ## -0,0 +1 ##
47
 ## -0,0 +1 ##
48
-+*
48
++*
49
 Added: svn:keywords
49
 Added: svn:keywords
50
 ## -0,0 +1 ##
50
 ## -0,0 +1 ##
51
-+Id
52
-
51
++Id
52
+

+ 9
- 9
tests/svn-log/out.side-by-side View File

24
 --- ChangeLog	(revision 1233)
24
 --- ChangeLog	(revision 1233)
25
 +++ ChangeLog	(revision 1234)
25
 +++ ChangeLog	(revision 1234)
26
 @@ -1,3 +1,6 @@
26
 @@ -1,3 +1,6 @@
27
-                                                                                   1 Version 0.0.4
28
-                                                                                   2     * Add prototype of perl module
29
-                                                                                   3 
27
+                                                                                   1 Version 0.0.4
28
+                                                                                   2     * Add prototype of perl module
29
+                                                                                   3 
30
 1 Version 0.0.3                                                                    4 Version 0.0.3
30
 1 Version 0.0.3                                                                    4 Version 0.0.3
31
 2     * Implement '-d' option                                                      5     * Implement '-d' option
31
 2     * Implement '-d' option                                                      5     * Implement '-d' option
32
 3     * Add configfile to set global debug flag                                    6     * Add configfile to set global debug flag
32
 3     * Add configfile to set global debug flag                                    6     * Add configfile to set global debug flag
35
 --- src/share/example.sh	(revision 0)
35
 --- src/share/example.sh	(revision 0)
36
 +++ src/share/example.sh	(revision 1234)
36
 +++ src/share/example.sh	(revision 1234)
37
 @@ -0,0 +1,4 @@
37
 @@ -0,0 +1,4 @@
38
-                                                                                     1 #!/bin/sh
39
-                                                                                     2 #
40
-                                                                                     3 # Test program, also try run me as yroot (sudo ./example.sh)
41
-                                                                                     4 #
38
+                                                                                     1 #!/bin/sh
39
+                                                                                     2 #
40
+                                                                                     3 # Test program, also try run me as yroot (sudo ./example.sh)
41
+                                                                                     4 #
42
 
42
 
43
 Property changes on: src/share/example.sh
43
 Property changes on: src/share/example.sh
44
 ___________________________________________________________________
44
 ___________________________________________________________________
45
 Added: svn:executable
45
 Added: svn:executable
46
 ## -0,0 +1 ##
46
 ## -0,0 +1 ##
47
-                                                                                     1 *
47
+                                                                                     1 *
48
 Added: svn:keywords
48
 Added: svn:keywords
49
 ## -0,0 +1 ##
49
 ## -0,0 +1 ##
50
-                                                                                     1 Id
50
+                                                                                     1 Id

+ 9
- 9
tests/svn-log/out.w70 View File

24
 --- ChangeLog	(revision 1233)
24
 --- ChangeLog	(revision 1233)
25
 +++ ChangeLog	(revision 1234)
25
 +++ ChangeLog	(revision 1234)
26
 @@ -1,3 +1,6 @@
26
 @@ -1,3 +1,6 @@
27
-                                                                         1 Version 0.0.4
28
-                                                                         2     * Add prototype of perl module
29
-                                                                         3 
27
+                                                                         1 Version 0.0.4
28
+                                                                         2     * Add prototype of perl module
29
+                                                                         3 
30
 1 Version 0.0.3                                                          4 Version 0.0.3
30
 1 Version 0.0.3                                                          4 Version 0.0.3
31
 2     * Implement '-d' option                                            5     * Implement '-d' option
31
 2     * Implement '-d' option                                            5     * Implement '-d' option
32
 3     * Add configfile to set global debug flag                          6     * Add configfile to set global debug flag
32
 3     * Add configfile to set global debug flag                          6     * Add configfile to set global debug flag
35
 --- src/share/example.sh	(revision 0)
35
 --- src/share/example.sh	(revision 0)
36
 +++ src/share/example.sh	(revision 1234)
36
 +++ src/share/example.sh	(revision 1234)
37
 @@ -0,0 +1,4 @@
37
 @@ -0,0 +1,4 @@
38
-                                                                           1 #!/bin/sh
39
-                                                                           2 #
40
-                                                                           3 # Test program, also try run me as yroot (sudo ./example.sh)
41
-                                                                           4 #
38
+                                                                           1 #!/bin/sh
39
+                                                                           2 #
40
+                                                                           3 # Test program, also try run me as yroot (sudo ./example.sh)
41
+                                                                           4 #
42
 
42
 
43
 Property changes on: src/share/example.sh
43
 Property changes on: src/share/example.sh
44
 ___________________________________________________________________
44
 ___________________________________________________________________
45
 Added: svn:executable
45
 Added: svn:executable
46
 ## -0,0 +1 ##
46
 ## -0,0 +1 ##
47
-                                                                           1 *
47
+                                                                           1 *
48
 Added: svn:keywords
48
 Added: svn:keywords
49
 ## -0,0 +1 ##
49
 ## -0,0 +1 ##
50
-                                                                           1 Id
50
+                                                                           1 Id

+ 1
- 1
tests/svn-merge/out.normal View File

8
 Modified: svn:mergeinfo
8
 Modified: svn:mergeinfo
9
    Merged /repository/foo/branches/foo-bar:r4-9
9
    Merged /repository/foo/branches/foo-bar:r4-9
10
    Merged /repository/foo/trunk/foo:r2-3
10
    Merged /repository/foo/trunk/foo:r2-3
11
-
11
+

+ 1
- 1
tests/svn-merge/out.side-by-side View File

8
 Modified: svn:mergeinfo
8
 Modified: svn:mergeinfo
9
    Merged /repository/foo/branches/foo-bar:r4-9
9
    Merged /repository/foo/branches/foo-bar:r4-9
10
    Merged /repository/foo/trunk/foo:r2-3
10
    Merged /repository/foo/trunk/foo:r2-3
11
-
11
+

+ 1
- 1
tests/svn-merge/out.w70 View File

8
 Modified: svn:mergeinfo
8
 Modified: svn:mergeinfo
9
    Merged /repository/foo/branches/foo-bar:r4-9
9
    Merged /repository/foo/branches/foo-bar:r4-9
10
    Merged /repository/foo/trunk/foo:r2-3
10
    Merged /repository/foo/trunk/foo:r2-3
11
-
11
+

+ 1
- 1
tests/svn-property/out.normal View File

2
 ===================================================================
2
 ===================================================================
3
 Cannot display: file marked as a binary type.
3
 Cannot display: file marked as a binary type.
4
 svn:mime-type = application/octet-stream
4
 svn:mime-type = application/octet-stream
5
-
5
+

+ 1
- 1
tests/svn-property/out.side-by-side View File

2
 ===================================================================
2
 ===================================================================
3
 Cannot display: file marked as a binary type.
3
 Cannot display: file marked as a binary type.
4
 svn:mime-type = application/octet-stream
4
 svn:mime-type = application/octet-stream
5
-
5
+

+ 1
- 1
tests/svn-property/out.w70 View File

2
 ===================================================================
2
 ===================================================================
3
 Cannot display: file marked as a binary type.
3
 Cannot display: file marked as a binary type.
4
 svn:mime-type = application/octet-stream
4
 svn:mime-type = application/octet-stream
5
-
5
+

+ 5
- 5
tests/svn/out.normal View File

15
  ## Usage of coderev.sh
15
  ## Usage of coderev.sh
16
  
16
  
17
 -Just type `./coderev.sh -h` to see the usage.
17
 -Just type `./coderev.sh -h` to see the usage.
18
-+Just type `./coderev.sh --help` to see the usage.
18
++Just type `./coderev.sh --help` to see the usage.
19
  
19
  
20
      Usage:
20
      Usage:
21
-+
21
++
22
          coderev.sh [-r revision] [-w width] [-o outdir] [-y] [-d name] \
22
          coderev.sh [-r revision] [-w width] [-o outdir] [-y] [-d name] \
23
                  [-F comment-file | -m 'comment...'] [file...]
23
                  [-F comment-file | -m 'comment...'] [file...]
24
  
24
  
26
                              specify column number where lines are broken and
26
                              specify column number where lines are broken and
27
                              wrapped for sdiff, default is no line wrapping
27
                              wrapped for sdiff, default is no line wrapping
28
      -y, --yes             do not prompt for overwriting
28
      -y, --yes             do not prompt for overwriting
29
-+
30
-+# EOF
31
-
29
++
30
++# EOF
31
+

+ 3
- 3
tests/svn/out.side-by-side View File

17
  21 Just type `./coderev.sh -h` to see the usage.                                     20 Just type `./coderev.sh --help` to see the usage.
17
  21 Just type `./coderev.sh -h` to see the usage.                                     20 Just type `./coderev.sh --help` to see the usage.
18
  22                                                                                   21 
18
  22                                                                                   21 
19
  23     Usage:                                                                        22     Usage:
19
  23     Usage:                                                                        22     Usage:
20
-                                                                                      23 
20
+                                                                                      23 
21
  24         coderev.sh [-r revision] [-w width] [-o outdir] [-y] [-d name] \          24         coderev.sh [-r revision] [-w width] [-o outdir] [-y] [-d name] \
21
  24         coderev.sh [-r revision] [-w width] [-o outdir] [-y] [-d name] \          24         coderev.sh [-r revision] [-w width] [-o outdir] [-y] [-d name] \
22
  25                 [-F comment-file | -m 'comment...'] [file...]                     25                 [-F comment-file | -m 'comment...'] [file...]
22
  25                 [-F comment-file | -m 'comment...'] [file...]                     25                 [-F comment-file | -m 'comment...'] [file...]
23
  26                                                                                   26 
23
  26                                                                                   26 
25
 145                             specify column number where lines are broken and     145                             specify column number where lines are broken and
25
 145                             specify column number where lines are broken and     145                             specify column number where lines are broken and
26
 146                             wrapped for sdiff, default is no line wrapping       146                             wrapped for sdiff, default is no line wrapping
26
 146                             wrapped for sdiff, default is no line wrapping       146                             wrapped for sdiff, default is no line wrapping
27
 147     -y, --yes             do not prompt for overwriting                          147     -y, --yes             do not prompt for overwriting
27
 147     -y, --yes             do not prompt for overwriting                          147     -y, --yes             do not prompt for overwriting
28
-                                                                                     148 
29
-                                                                                     149 # EOF
28
+                                                                                     148 
29
+                                                                                     149 # EOF

+ 3
- 3
tests/svn/out.w70 View File

17
  21 Just type `./coderev.sh -h` to see the usage.                           20 Just type `./coderev.sh --help` to see the usage.
17
  21 Just type `./coderev.sh -h` to see the usage.                           20 Just type `./coderev.sh --help` to see the usage.
18
  22                                                                         21 
18
  22                                                                         21 
19
  23     Usage:                                                              22     Usage:
19
  23     Usage:                                                              22     Usage:
20
-                                                                            23 
20
+                                                                            23 
21
  24         coderev.sh [-r revision] [-w width] [-o outdir] [-y] [-d name>  24         coderev.sh [-r revision] [-w width] [-o outdir] [-y] [-d name>
21
  24         coderev.sh [-r revision] [-w width] [-o outdir] [-y] [-d name>  24         coderev.sh [-r revision] [-w width] [-o outdir] [-y] [-d name>
22
  25                 [-F comment-file | -m 'comment...'] [file...]           25                 [-F comment-file | -m 'comment...'] [file...]
22
  25                 [-F comment-file | -m 'comment...'] [file...]           25                 [-F comment-file | -m 'comment...'] [file...]
23
  26                                                                         26 
23
  26                                                                         26 
25
 145                             specify column number where lines are bro> 145                             specify column number where lines are bro>
25
 145                             specify column number where lines are bro> 145                             specify column number where lines are bro>
26
 146                             wrapped for sdiff, default is no line wra> 146                             wrapped for sdiff, default is no line wra>
26
 146                             wrapped for sdiff, default is no line wra> 146                             wrapped for sdiff, default is no line wra>
27
 147     -y, --yes             do not prompt for overwriting                147     -y, --yes             do not prompt for overwriting
27
 147     -y, --yes             do not prompt for overwriting                147     -y, --yes             do not prompt for overwriting
28
-                                                                           148 
29
-                                                                           149 # EOF
28
+                                                                           148 
29
+                                                                           149 # EOF

+ 6
- 6
tests/test_cdiff.py View File

182
         self.assertEqual(out[0], '\x1b[33m--- old\n\x1b[0m')
182
         self.assertEqual(out[0], '\x1b[33m--- old\n\x1b[0m')
183
         self.assertEqual(out[1], '\x1b[33m+++ new\n\x1b[0m')
183
         self.assertEqual(out[1], '\x1b[33m+++ new\n\x1b[0m')
184
         self.assertEqual(out[2], '\x1b[1;34m@@ -0,0 +1 @@\n\x1b[0m')
184
         self.assertEqual(out[2], '\x1b[1;34m@@ -0,0 +1 @@\n\x1b[0m')
185
-        self.assertEqual(out[3], '\x1b[1;32m+spam\n\x1b[0m')
185
+        self.assertEqual(out[3], '\x1b[32m+spam\n\x1b[0m')
186
 
186
 
187
     def test_markup_traditional_both_changed(self):
187
     def test_markup_traditional_both_changed(self):
188
         hunk = cdiff.Hunk([], '@@ -1,2 +1,2 @@\n', (1, 2), (1, 2))
188
         hunk = cdiff.Hunk([], '@@ -1,2 +1,2 @@\n', (1, 2), (1, 2))
204
             '\x1b[4m\x1b[31ma\x1b[0m\x1b[31m\n\x1b[0m')
204
             '\x1b[4m\x1b[31ma\x1b[0m\x1b[31m\n\x1b[0m')
205
         self.assertEqual(
205
         self.assertEqual(
206
             out[4],
206
             out[4],
207
-            '\x1b[1;32m+\x1b[0m\x1b[32mhell'
207
+            '\x1b[32m+\x1b[0m\x1b[32mhell'
208
             '\x1b[4m\x1b[32mo\x1b[0m\x1b[32m\n\x1b[0m')
208
             '\x1b[4m\x1b[32mo\x1b[0m\x1b[32m\n\x1b[0m')
209
         self.assertEqual(out[5], '\x1b[0m common\n\x1b[0m')
209
         self.assertEqual(out[5], '\x1b[0m common\n\x1b[0m')
210
 
210
 
235
             '\x1b[33m '
235
             '\x1b[33m '
236
             '\x1b[0m         '
236
             '\x1b[0m         '
237
             '\x1b[0m\x1b[33m2\x1b[0m '
237
             '\x1b[0m\x1b[33m2\x1b[0m '
238
-            '\x1b[1;32mspammm\x1b[0m\n')
238
+            '\x1b[32mspammm\x1b[0m\n')
239
         self.assertEqual(
239
         self.assertEqual(
240
             out[7],
240
             out[7],
241
             '\x1b[33m2\x1b[0m '
241
             '\x1b[33m2\x1b[0m '
279
             '\x1b[33m '
279
             '\x1b[33m '
280
             '\x1b[0m  ' + (' ' * 80) +
280
             '\x1b[0m  ' + (' ' * 80) +
281
             '\x1b[0m\x1b[33m2\x1b[0m '
281
             '\x1b[0m\x1b[33m2\x1b[0m '
282
-            '\x1b[1;32mspammm\x1b[0m\n')
282
+            '\x1b[32mspammm\x1b[0m\n')
283
         self.assertEqual(
283
         self.assertEqual(
284
             out[7],
284
             out[7],
285
             '\x1b[33m2\x1b[0m '
285
             '\x1b[33m2\x1b[0m '
325
             out[6],
325
             out[6],
326
             '\x1b[33m \x1b[0m        '
326
             '\x1b[33m \x1b[0m        '
327
             '\x1b[0m\x1b[33m2\x1b[0m '
327
             '\x1b[0m\x1b[33m2\x1b[0m '
328
-            '\x1b[1;32mspammm\x1b[0m\n')
328
+            '\x1b[32mspammm\x1b[0m\n')
329
         self.assertEqual(
329
         self.assertEqual(
330
             out[7],
330
             out[7],
331
             '\x1b[33m2\x1b[0m '
331
             '\x1b[33m2\x1b[0m '
371
             '\x1b[33m \x1b[0m       '
371
             '\x1b[33m \x1b[0m       '
372
             '\x1b[0m\x1b[33m2\x1b[0m '
372
             '\x1b[0m\x1b[33m2\x1b[0m '
373
             ''
373
             ''
374
-            '\x1b[1;32mspam\x1b[0m\x1b[1;35m>\x1b[0m\n')
374
+            '\x1b[32mspam\x1b[0m\x1b[1;35m>\x1b[0m\n')
375
         self.assertEqual(
375
         self.assertEqual(
376
             out[7],
376
             out[7],
377
             '\x1b[33m2\x1b[0m '
377
             '\x1b[33m2\x1b[0m '