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
15 atf_test_case conflicting_format
20 atf_check -o file:$(atf_get_srcdir)/simple.out -s eq:1 \
21 diff "$(atf_get_srcdir)/input1.in" "$(atf_get_srcdir)/input2.in"
23 atf_check -o file:$(atf_get_srcdir)/simple_e.out -s eq:1 \
24 diff -e "$(atf_get_srcdir)/input1.in" "$(atf_get_srcdir)/input2.in"
26 atf_check -o file:$(atf_get_srcdir)/simple_u.out -s eq:1 \
27 diff -u -L input1 -L input2 "$(atf_get_srcdir)/input1.in" "$(atf_get_srcdir)/input2.in"
29 atf_check -o file:$(atf_get_srcdir)/simple_n.out -s eq:1 \
30 diff -n "$(atf_get_srcdir)/input1.in" "$(atf_get_srcdir)/input2.in"
32 atf_check -o inline:"Files $(atf_get_srcdir)/input1.in and $(atf_get_srcdir)/input2.in differ\n" -s eq:1 \
33 diff -q "$(atf_get_srcdir)/input1.in" "$(atf_get_srcdir)/input2.in"
36 diff -q "$(atf_get_srcdir)/input1.in" "$(atf_get_srcdir)/input1.in"
38 atf_check -o file:$(atf_get_srcdir)/simple_i.out -s eq:1 \
39 diff -i "$(atf_get_srcdir)/input_c1.in" "$(atf_get_srcdir)/input_c2.in"
41 atf_check -o file:$(atf_get_srcdir)/simple_w.out -s eq:1 \
42 diff -w "$(atf_get_srcdir)/input_c1.in" "$(atf_get_srcdir)/input_c2.in"
44 atf_check -o file:$(atf_get_srcdir)/simple_b.out -s eq:1 \
45 diff -b "$(atf_get_srcdir)/input_c1.in" "$(atf_get_srcdir)/input_c2.in"
47 atf_check -o file:$(atf_get_srcdir)/simple_p.out -s eq:1 \
48 diff --label input_c1.in --label input_c2.in -p "$(atf_get_srcdir)/input_c1.in" "$(atf_get_srcdir)/input_c2.in"
53 atf_check -o file:$(atf_get_srcdir)/unified_p.out -s eq:1 \
54 diff -up -L input_c1.in -L input_c2.in "$(atf_get_srcdir)/input_c1.in" "$(atf_get_srcdir)/input_c2.in"
55 atf_check -o file:$(atf_get_srcdir)/unified_9999.out -s eq:1 \
56 diff -u9999 -L input_c1.in -L input_c2.in "$(atf_get_srcdir)/input_c1.in" "$(atf_get_srcdir)/input_c2.in"
61 printf 'a\nb\r\nc\n' > b230049_a.in
62 printf 'a\r\nb\r\nc\r\n' > b230049_b.in
63 atf_check -o empty -s eq:0 \
64 diff -up --strip-trailing-cr -L b230049_a.in -L b230049_b.in \
65 b230049_a.in b230049_b.in
73 touch -d 2015-04-03T01:02:03 empty
74 touch -d 2016-12-22T11:22:33 hello
75 atf_check -o "file:$(atf_get_srcdir)/header.out" -s eq:1 \
84 touch -d 2015-04-03T01:02:03.123456789 empty
85 touch -d 2016-12-22T11:22:33.987654321 hello
86 atf_check -o "file:$(atf_get_srcdir)/header_ns.out" -s eq:1 \
92 atf_check -o file:$(atf_get_srcdir)/ifdef.out -s eq:1 \
93 diff -D PLOP "$(atf_get_srcdir)/input_c1.in" \
94 "$(atf_get_srcdir)/input_c2.in"
99 atf_check -o file:$(atf_get_srcdir)/group-format.out -s eq:1 \
100 diff --changed-group-format='<<<<<<< (local)
103 ' "$(atf_get_srcdir)/input_c1.in" "$(atf_get_srcdir)/input_c2.in"
108 atf_check -o save:A printf "A\nB\nC\n"
109 atf_check -o save:B printf "D\nB\nE\n"
111 exp_output=$(printf "A[[:space:]]+|[[:space:]]+D\nB[[:space:]]+B\nC[[:space:]]+|[[:space:]]+E")
112 exp_output_suppressed=$(printf "A[[:space:]]+|[[:space:]]+D\nC[[:space:]]+|[[:space:]]+E")
114 atf_check -o match:"$exp_output" -s exit:1 \
115 diff --side-by-side A B
116 atf_check -o match:"$exp_output" -s exit:1 \
118 atf_check -o match:"$exp_output_suppressed" -s exit:1 \
119 diff -y --suppress-common-lines A B
120 atf_check -o match:"$exp_output_suppressed" -s exit:1 \
121 diff -W 65 -y --suppress-common-lines A B
128 atf_check -x "echo 1 > A/test-file"
129 atf_check -x "echo 2 > B/test-file"
134 atf_check -x "echo 3 > D/another-test-file"
138 -o inline:"Files A/test-file and B/test-file differ\n" \
141 atf_check diff -rq A C
145 -o inline:"Only in D: another-test-file\n" \
150 -o inline:"Files A/another-test-file and D/another-test-file differ\n" \
156 atf_check -x 'printf "A\nB\n" > A'
157 atf_check -x 'printf "A\n\nB\n" > B'
158 atf_check -x 'printf "A\n \nB\n" > C'
159 atf_check -x 'printf "A\nC\nB\n" > D'
160 atf_check -x 'printf "A\nB\nC\nD\nE\nF\nG\nH" > E'
161 atf_check -x 'printf "A\n\nB\nC\nD\nE\nF\nX\nH" > F'
163 atf_check -s exit:0 -o inline:"" diff -B A B
164 atf_check -s exit:1 -o file:"$(atf_get_srcdir)/Bflag_C.out" diff -B A C
165 atf_check -s exit:1 -o file:"$(atf_get_srcdir)/Bflag_D.out" diff -B A D
166 atf_check -s exit:1 -o file:"$(atf_get_srcdir)/Bflag_F.out" diff -B E F
171 atf_check -x 'printf "foo" > A'
173 atf_check -s exit:1 -o ignore -e ignore diff -N A NOFILE
174 atf_check -s exit:1 -o ignore -e ignore diff -N NOFILE A
175 atf_check -s exit:2 -o ignore -e ignore diff -N NOFILE1 NOFILE2
183 atf_check -s exit:1 \
184 -o inline:"1c1\n< A\n---\n> B\n" \
185 diff -t --tabsize 1 A B
188 conflicting_format_body()
193 atf_check -s exit:2 -e ignore diff -c -u A B
194 atf_check -s exit:2 -e ignore diff -e -f A B
195 atf_check -s exit:2 -e ignore diff -y -q A B
196 atf_check -s exit:2 -e ignore diff -q -u A B
197 atf_check -s exit:2 -e ignore diff -q -c A B
198 atf_check -s exit:2 -e ignore diff --normal -c A B
199 atf_check -s exit:2 -e ignore diff -c --normal A B
201 atf_check -s exit:1 -o ignore -e ignore diff -u -u A B
202 atf_check -s exit:1 -o ignore -e ignore diff -e -e A B
203 atf_check -s exit:1 -o ignore -e ignore diff -y -y A B
204 atf_check -s exit:1 -o ignore -e ignore diff -q -q A B
205 atf_check -s exit:1 -o ignore -e ignore diff -c -c A B
206 atf_check -s exit:1 -o ignore -e ignore diff --normal --normal A B
213 atf_check -o inline:"Files hello and world are identical\n" \
214 -s exit:0 diff --label hello --label world -s A A
216 atf_check -o inline:"Binary files hello and world differ\n" \
217 -s exit:1 diff --label hello --label world `which diff` `which ls`
220 atf_init_test_cases()
222 atf_add_test_case simple
223 atf_add_test_case unified
224 atf_add_test_case header
225 atf_add_test_case header_ns
226 atf_add_test_case ifdef
227 atf_add_test_case group_format
228 atf_add_test_case side_by_side
229 atf_add_test_case brief_format
230 atf_add_test_case b230049
231 atf_add_test_case Bflag
232 atf_add_test_case Nflag
233 atf_add_test_case tabsize
234 atf_add_test_case conflicting_format
235 atf_add_test_case label