Skip to content

Commit

Permalink
Fetch one diff first, output a separation line for the rest, if any
Browse files Browse the repository at this point in the history
  • Loading branch information
ymattw committed Nov 3, 2024
1 parent 3b924b9 commit 30466fb
Show file tree
Hide file tree
Showing 33 changed files with 128 additions and 55 deletions.
4 changes: 3 additions & 1 deletion tests/diff-ru-bin/out.normal
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,10 @@
 ../../cdiff.py -c always -s < in.diff > out.side-by-side
 ../../cdiff.py -c always -s < in.diff -w70 > out.w70
+# EOF
───────────────────────────────────────────────────────────────────────────────
Binary files a/foo.pdf and b/foo.pdf differ
diff -ru a/foo.txt b/foo.txt
───────────────────────────────────────────────────────────────────────────────
diff -ru a/foo.txt b/foo.txt
--- a/foo.txt 2013-02-23 19:55:03.000000000 +0800
+++ b/foo.txt 2013-02-23 19:55:10.000000000 +0800
@@ -1,2 +1,2 @@
Expand Down
6 changes: 4 additions & 2 deletions tests/diff-ru-bin/out.side-by-side
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,10 @@
5 ../../cdiff.py -c always -s < in.diff > out.side-by-side 4 ../../cdiff.py -c always -s < in.diff > out.side-by-side
6 ../../cdiff.py -c always -s < in.diff -w70 > out.w70 5 ../../cdiff.py -c always -s < in.diff -w70 > out.w70
  6 # EOF
Binary files a/foo.pdf and b/foo.pdf differ
diff -ru a/foo.txt b/foo.txt
───────────────────────────────────────────────────────────────────────────────
Binary files a/foo.pdf and b/foo.pdf differ
───────────────────────────────────────────────────────────────────────────────
diff -ru a/foo.txt b/foo.txt
--- a/foo.txt 2013-02-23 19:55:03.000000000 +0800
+++ b/foo.txt 2013-02-23 19:55:10.000000000 +0800
@@ -1,2 +1,2 @@
Expand Down
6 changes: 4 additions & 2 deletions tests/diff-ru-bin/out.w70
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,10 @@
5 ../../cdiff.py -c always -s < in.diff > out.side-by-side 4 ../../cdiff.py -c always -s < in.diff > out.side-by-side
6 ../../cdiff.py -c always -s < in.diff -w70 > out.w70 5 ../../cdiff.py -c always -s < in.diff -w70 > out.w70
  6 # EOF
Binary files a/foo.pdf and b/foo.pdf differ
diff -ru a/foo.txt b/foo.txt
───────────────────────────────────────────────────────────────────────────────
Binary files a/foo.pdf and b/foo.pdf differ
───────────────────────────────────────────────────────────────────────────────
diff -ru a/foo.txt b/foo.txt
--- a/foo.txt 2013-02-23 19:55:03.000000000 +0800
+++ b/foo.txt 2013-02-23 19:55:10.000000000 +0800
@@ -1,2 +1,2 @@
Expand Down
6 changes: 4 additions & 2 deletions tests/diff-ru-bin/out.w70.wrap
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,10 @@
5 ../../cdiff.py -c always -s < in.diff > out.side-by-side 4 ../../cdiff.py -c always -s < in.diff > out.side-by-side
6 ../../cdiff.py -c always -s < in.diff -w70 > out.w70 5 ../../cdiff.py -c always -s < in.diff -w70 > out.w70
  6 # EOF
Binary files a/foo.pdf and b/foo.pdf differ
diff -ru a/foo.txt b/foo.txt
───────────────────────────────────────────────────────────────────────────────
Binary files a/foo.pdf and b/foo.pdf differ
───────────────────────────────────────────────────────────────────────────────
diff -ru a/foo.txt b/foo.txt
--- a/foo.txt 2013-02-23 19:55:03.000000000 +0800
+++ b/foo.txt 2013-02-23 19:55:10.000000000 +0800
@@ -1,2 +1,2 @@
Expand Down
13 changes: 9 additions & 4 deletions tests/diff-ru/out.normal
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,19 @@
 ../../cdiff.py -c always -s in.diff > out.side-by-side
 ../../cdiff.py -c always -s in.diff -w70 > out.w70
+# EOF
───────────────────────────────────────────────────────────────────────────────
Only in a: a1
Only in b: b1
diff -ru a/common/foo.txt b/common/foo.txt
───────────────────────────────────────────────────────────────────────────────
Only in b: b1
───────────────────────────────────────────────────────────────────────────────
diff -ru a/common/foo.txt b/common/foo.txt
--- a/common/foo.txt 2013-02-22 20:28:32.000000000 +0800
+++ b/common/foo.txt 2013-02-22 20:30:18.000000000 +0800
@@ -1 +1 @@
-Hello
+world
Only in b: date.txt
Only in a: time.txt
───────────────────────────────────────────────────────────────────────────────
Only in b: date.txt
───────────────────────────────────────────────────────────────────────────────
Only in a: time.txt

15 changes: 10 additions & 5 deletions tests/diff-ru/out.side-by-side
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,18 @@
5 ../../cdiff.py -c always -s in.diff > out.side-by-side 4 ../../cdiff.py -c always -s in.diff > out.side-by-side
6 ../../cdiff.py -c always -s in.diff -w70 > out.w70 5 ../../cdiff.py -c always -s in.diff -w70 > out.w70
  6 # EOF
Only in a: a1
Only in b: b1
diff -ru a/common/foo.txt b/common/foo.txt
───────────────────────────────────────────────────────────────────────────────
Only in a: a1
───────────────────────────────────────────────────────────────────────────────
Only in b: b1
───────────────────────────────────────────────────────────────────────────────
diff -ru a/common/foo.txt b/common/foo.txt
--- a/common/foo.txt 2013-02-22 20:28:32.000000000 +0800
+++ b/common/foo.txt 2013-02-22 20:30:18.000000000 +0800
@@ -1 +1 @@
1 Hello 1 world
Only in b: date.txt
Only in a: time.txt
───────────────────────────────────────────────────────────────────────────────
Only in b: date.txt
───────────────────────────────────────────────────────────────────────────────
Only in a: time.txt

15 changes: 10 additions & 5 deletions tests/diff-ru/out.w70
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,18 @@
5 ../../cdiff.py -c always -s in.diff > out.side-by-side 4 ../../cdiff.py -c always -s in.diff > out.side-by-side
6 ../../cdiff.py -c always -s in.diff -w70 > out.w70 5 ../../cdiff.py -c always -s in.diff -w70 > out.w70
  6 # EOF
Only in a: a1
Only in b: b1
diff -ru a/common/foo.txt b/common/foo.txt
───────────────────────────────────────────────────────────────────────────────
Only in a: a1
───────────────────────────────────────────────────────────────────────────────
Only in b: b1
───────────────────────────────────────────────────────────────────────────────
diff -ru a/common/foo.txt b/common/foo.txt
--- a/common/foo.txt 2013-02-22 20:28:32.000000000 +0800
+++ b/common/foo.txt 2013-02-22 20:30:18.000000000 +0800
@@ -1 +1 @@
1 Hello 1 world
Only in b: date.txt
Only in a: time.txt
───────────────────────────────────────────────────────────────────────────────
Only in b: date.txt
───────────────────────────────────────────────────────────────────────────────
Only in a: time.txt

15 changes: 10 additions & 5 deletions tests/diff-ru/out.w70.wrap
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,18 @@
5 ../../cdiff.py -c always -s in.diff > out.side-by-side 4 ../../cdiff.py -c always -s in.diff > out.side-by-side
6 ../../cdiff.py -c always -s in.diff -w70 > out.w70 5 ../../cdiff.py -c always -s in.diff -w70 > out.w70
  6 # EOF
Only in a: a1
Only in b: b1
diff -ru a/common/foo.txt b/common/foo.txt
───────────────────────────────────────────────────────────────────────────────
Only in a: a1
───────────────────────────────────────────────────────────────────────────────
Only in b: b1
───────────────────────────────────────────────────────────────────────────────
diff -ru a/common/foo.txt b/common/foo.txt
--- a/common/foo.txt 2013-02-22 20:28:32.000000000 +0800
+++ b/common/foo.txt 2013-02-22 20:30:18.000000000 +0800
@@ -1 +1 @@
1 Hello 1 world
Only in b: date.txt
Only in a: time.txt
───────────────────────────────────────────────────────────────────────────────
Only in b: date.txt
───────────────────────────────────────────────────────────────────────────────
Only in a: time.txt

5 changes: 4 additions & 1 deletion tests/git-bin/out.normal
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,12 @@
 wkhtmltopdf --page-size A4 $INPUT $OUTPUT # very very long comments ends here
+
+# EOF
───────────────────────────────────────────────────────────────────────────────
diff --git a/example.pdf b/example.pdf
index 1eacfd8..3696851 100644
Binary files a/example.pdf and b/example.pdf differ
diff --git a/foo.html b/foo.html
───────────────────────────────────────────────────────────────────────────────
diff --git a/foo.html b/foo.html
index d2fd3fb..13afa6e 100644
--- a/foo.html
+++ b/foo.html
Expand All @@ -21,6 +23,7 @@
 <html>

 <head>
───────────────────────────────────────────────────────────────────────────────
diff --git a/foo.pdf b/foo.pdf
index 0e90017..3c3b90d 100644
Binary files a/foo.pdf and b/foo.pdf differ
Expand Down
9 changes: 6 additions & 3 deletions tests/git-bin/out.side-by-side
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,12 @@
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
  16 
  17 # EOF
diff --git a/example.pdf b/example.pdf
───────────────────────────────────────────────────────────────────────────────
diff --git a/example.pdf b/example.pdf
index 1eacfd8..3696851 100644
Binary files a/example.pdf and b/example.pdf differ
diff --git a/foo.html b/foo.html
───────────────────────────────────────────────────────────────────────────────
diff --git a/foo.html b/foo.html
index d2fd3fb..13afa6e 100644
--- a/foo.html
+++ b/foo.html
Expand All @@ -20,7 +22,8 @@
2 <html> 2 <html>
3  3 
4 <head> 4 <head>
diff --git a/foo.pdf b/foo.pdf
───────────────────────────────────────────────────────────────────────────────
diff --git a/foo.pdf b/foo.pdf
index 0e90017..3c3b90d 100644
Binary files a/foo.pdf and b/foo.pdf differ

Loading

0 comments on commit 30466fb

Please sign in to comment.