Skip to content

Commit 57da574

Browse files
committed
Mark lsdiff-lines-option and lsdiff-hunks-options tests as expected-fail
Those features just doesn't work at all.
1 parent 364b7a4 commit 57da574

2 files changed

Lines changed: 39 additions & 12 deletions

File tree

Makefile.am

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -310,7 +310,9 @@ TESTS = tests/newline1/run-test \
310310
XFAIL_TESTS = \
311311
tests/delhunk5/run-test \
312312
tests/delhunk6/run-test \
313-
tests/rediff-empty-hunk/run-test
313+
tests/rediff-empty-hunk/run-test \
314+
tests/lsdiff-hunks-option/run-test \
315+
tests/lsdiff-lines-option/run-test
314316

315317
test-perms: src/combinediff$(EXEEXT) src/flipdiff$(EXEEXT) \
316318
src/lsdiff$(EXEEXT) src/grepdiff$(EXEEXT) src/patchview$(EXEEXT) \

tests/lsdiff-hunks-option/run-test

Lines changed: 36 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,6 @@ cat << EOF > diff
1212
-A
1313
+a
1414
+b
15-
@@ -10 +11,2 @@
16-
-C
17-
+c
18-
+d
1915
--- file2
2016
+++ file2
2117
@@ -5 +5,2 @@
@@ -26,40 +22,69 @@ cat << EOF > diff
2622
-G
2723
+g
2824
+h
25+
--- file3
26+
+++ file3
27+
@@ -10 +10,2 @@
28+
-I
29+
+i
30+
+j
31+
@@ -15 +16,2 @@
32+
-K
33+
+k
34+
+l
35+
@@ -25 +27,2 @@
36+
-M
37+
+m
38+
+n
2939
EOF
3040

31-
# Test --hunks 1 (first hunk from each file)
41+
# Test --hunks 1 (first hunk - all files have at least 1 hunk)
3242
${LSDIFF} --hunks 1 diff 2>errors >hunks1 || exit 1
3343
[ -s errors ] && exit 1
3444

3545
cat << EOF | cmp - hunks1 || exit 1
3646
file1
3747
file2
48+
file3
3849
EOF
3950

40-
# Test --hunks 2 (second hunk from each file)
51+
# Test --hunks 2 (second hunk - only file2 and file3 have 2+ hunks)
4152
${LSDIFF} --hunks 2 diff 2>errors >hunks2 || exit 1
4253
[ -s errors ] && exit 1
4354

4455
cat << EOF | cmp - hunks2 || exit 1
45-
file1
4656
file2
57+
file3
4758
EOF
4859

49-
# Test --hunks 3 (third hunk - lsdiff still shows files even if hunks don't match)
60+
# Test --hunks 3 (third hunk - only file3 has 3 hunks)
5061
${LSDIFF} --hunks 3 diff 2>errors >hunks3 || exit 1
5162
[ -s errors ] && exit 1
5263

5364
cat << EOF | cmp - hunks3 || exit 1
54-
file1
55-
file2
65+
file3
5666
EOF
5767

58-
# Test --hunks 1-2 (range: first and second hunks)
68+
# Test --hunks 1-2 (range: first and second hunks - all files have hunk 1, file2 and file3 have hunk 2)
5969
${LSDIFF} --hunks 1-2 diff 2>errors >hunks1-2 || exit 1
6070
[ -s errors ] && exit 1
6171

6272
cat << EOF | cmp - hunks1-2 || exit 1
6373
file1
6474
file2
75+
file3
76+
EOF
77+
78+
# Test --hunks 2-3 (range: second and third hunks - file2 has hunk 2, file3 has hunks 2 and 3)
79+
${LSDIFF} --hunks 2-3 diff 2>errors >hunks2-3 || exit 1
80+
[ -s errors ] && exit 1
81+
82+
cat << EOF | cmp - hunks2-3 || exit 1
83+
file2
84+
file3
6585
EOF
86+
87+
# Test --hunks 4 (fourth hunk - no files have 4 hunks, should be empty)
88+
${LSDIFF} --hunks 4 diff 2>errors >hunks4 || exit 1
89+
[ -s errors ] && exit 1
90+
[ -s hunks4 ] && exit 1 # Should be empty

0 commit comments

Comments
 (0)