6 atf_test_case header_ns
8 atf_test_case group_format
9 atf_test_case side_by_side
10 atf_test_case brief_format
14 atf_test_case conflicting_format
18 atf_check -o file:$(atf_get_srcdir)/simple.out -s eq:1 \
19 diff "$(atf_get_srcdir)/input1.in" "$(atf_get_srcdir)/input2.in"
21 atf_check -o file:$(atf_get_srcdir)/simple_e.out -s eq:1 \
22 diff -e "$(atf_get_srcdir)/input1.in" "$(atf_get_srcdir)/input2.in"
24 atf_check -o file:$(atf_get_srcdir)/simple_u.out -s eq:1 \
25 diff -u -L input1 -L input2 "$(atf_get_srcdir)/input1.in" "$(atf_get_srcdir)/input2.in"
27 atf_check -o file:$(atf_get_srcdir)/simple_n.out -s eq:1 \
28 diff -n "$(atf_get_srcdir)/input1.in" "$(atf_get_srcdir)/input2.in"
30 atf_check -o inline:"Files $(atf_get_srcdir)/input1.in and $(atf_get_srcdir)/input2.in differ\n" -s eq:1 \
31 diff -q "$(atf_get_srcdir)/input1.in" "$(atf_get_srcdir)/input2.in"
34 diff -q "$(atf_get_srcdir)/input1.in" "$(atf_get_srcdir)/input1.in"
36 atf_check -o file:$(atf_get_srcdir)/simple_i.out -s eq:1 \
37 diff -i "$(atf_get_srcdir)/input_c1.in" "$(atf_get_srcdir)/input_c2.in"
39 atf_check -o file:$(atf_get_srcdir)/simple_w.out -s eq:1 \
40 diff -w "$(atf_get_srcdir)/input_c1.in" "$(atf_get_srcdir)/input_c2.in"
42 atf_check -o file:$(atf_get_srcdir)/simple_b.out -s eq:1 \
43 diff -b "$(atf_get_srcdir)/input_c1.in" "$(atf_get_srcdir)/input_c2.in"
45 atf_check -o file:$(atf_get_srcdir)/simple_p.out -s eq:1 \
46 diff --label input_c1.in --label input_c2.in -p "$(atf_get_srcdir)/input_c1.in" "$(atf_get_srcdir)/input_c2.in"
51 atf_check -o file:$(atf_get_srcdir)/unified_p.out -s eq:1 \
52 diff -up -L input_c1.in -L input_c2.in "$(atf_get_srcdir)/input_c1.in" "$(atf_get_srcdir)/input_c2.in"
53 atf_check -o file:$(atf_get_srcdir)/unified_9999.out -s eq:1 \
54 diff -u9999 -L input_c1.in -L input_c2.in "$(atf_get_srcdir)/input_c1.in" "$(atf_get_srcdir)/input_c2.in"
59 printf 'a\nb\r\nc\n' > b230049_a.in
60 printf 'a\r\nb\r\nc\r\n' > b230049_b.in
61 atf_check -o empty -s eq:0 \
62 diff -up --strip-trailing-cr -L b230049_a.in -L b230049_b.in \
63 b230049_a.in b230049_b.in
71 touch -d 2015-04-03T01:02:03 empty
72 touch -d 2016-12-22T11:22:33 hello
73 atf_check -o "file:$(atf_get_srcdir)/header.out" -s eq:1 \
82 touch -d 2015-04-03T01:02:03.123456789 empty
83 touch -d 2016-12-22T11:22:33.987654321 hello
84 atf_check -o "file:$(atf_get_srcdir)/header_ns.out" -s eq:1 \
90 atf_check -o file:$(atf_get_srcdir)/ifdef.out -s eq:1 \
91 diff -D PLOP "$(atf_get_srcdir)/input_c1.in" \
92 "$(atf_get_srcdir)/input_c2.in"
97 atf_check -o file:$(atf_get_srcdir)/group-format.out -s eq:1 \
98 diff --changed-group-format='<<<<<<< (local)
101 ' "$(atf_get_srcdir)/input_c1.in" "$(atf_get_srcdir)/input_c2.in"
106 atf_check -o save:A printf "A\nB\nC\n"
107 atf_check -o save:B printf "D\nB\nE\n"
109 exp_output=$(printf "A[[:space:]]+|[[:space:]]+D\nB[[:space:]]+B\nC[[:space:]]+|[[:space:]]+E")
110 exp_output_suppressed=$(printf "A[[:space:]]+|[[:space:]]+D\nC[[:space:]]+|[[:space:]]+E")
112 atf_check -o match:"$exp_output" -s exit:1 \
113 diff --side-by-side A B
114 atf_check -o match:"$exp_output" -s exit:1 \
116 atf_check -o match:"$exp_output_suppressed" -s exit:1 \
117 diff -y --suppress-common-lines A B
118 atf_check -o match:"$exp_output_suppressed" -s exit:1 \
119 diff -W 65 -y --suppress-common-lines A B
126 atf_check -x "echo 1 > A/test-file"
127 atf_check -x "echo 2 > B/test-file"
132 atf_check -x "echo 3 > D/another-test-file"
136 -o inline:"Files A/test-file and B/test-file differ\n" \
139 atf_check diff -rq A C
143 -o inline:"Only in D: another-test-file\n" \
148 -o inline:"Files A/another-test-file and D/another-test-file differ\n" \
154 atf_check -x 'printf "A\nB\n" > A'
155 atf_check -x 'printf "A\n\nB\n" > B'
156 atf_check -x 'printf "A\n \nB\n" > C'
157 atf_check -x 'printf "A\nC\nB\n" > D'
158 atf_check -x 'printf "A\nB\nC\nD\nE\nF\nG\nH" > E'
159 atf_check -x 'printf "A\n\nB\nC\nD\nE\nF\nX\nH" > F'
161 atf_check -s exit:0 -o inline:"" diff -B A B
162 atf_check -s exit:1 -o file:"$(atf_get_srcdir)/Bflag_C.out" diff -B A C
163 atf_check -s exit:1 -o file:"$(atf_get_srcdir)/Bflag_D.out" diff -B A D
164 atf_check -s exit:1 -o file:"$(atf_get_srcdir)/Bflag_F.out" diff -B E F
172 atf_check -s exit:1 \
173 -o inline:"1c1\n< A\n---\n> B\n" \
174 diff -t --tabsize 1 A B
177 conflicting_format_body()
182 atf_check -s exit:2 -e ignore diff -c -u A B
183 atf_check -s exit:2 -e ignore diff -e -f A B
184 atf_check -s exit:2 -e ignore diff -y -q A B
185 atf_check -s exit:2 -e ignore diff -q -u A B
186 atf_check -s exit:2 -e ignore diff -q -c A B
187 atf_check -s exit:2 -e ignore diff --normal -c A B
188 atf_check -s exit:2 -e ignore diff -c --normal A B
190 atf_check -s exit:1 -o ignore -e ignore diff -u -u A B
191 atf_check -s exit:1 -o ignore -e ignore diff -e -e A B
192 atf_check -s exit:1 -o ignore -e ignore diff -y -y A B
193 atf_check -s exit:1 -o ignore -e ignore diff -q -q A B
194 atf_check -s exit:1 -o ignore -e ignore diff -c -c A B
195 atf_check -s exit:1 -o ignore -e ignore diff --normal --normal A B
198 atf_init_test_cases()
200 atf_add_test_case simple
201 atf_add_test_case unified
202 atf_add_test_case header
203 atf_add_test_case header_ns
204 atf_add_test_case ifdef
205 atf_add_test_case group_format
206 atf_add_test_case side_by_side
207 atf_add_test_case brief_format
208 atf_add_test_case b230049
209 atf_add_test_case Bflag
210 atf_add_test_case tabsize
211 atf_add_test_case conflicting_format