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
16 atf_check -o file:$(atf_get_srcdir)/simple.out -s eq:1 \
17 diff "$(atf_get_srcdir)/input1.in" "$(atf_get_srcdir)/input2.in"
19 atf_check -o file:$(atf_get_srcdir)/simple_e.out -s eq:1 \
20 diff -e "$(atf_get_srcdir)/input1.in" "$(atf_get_srcdir)/input2.in"
22 atf_check -o file:$(atf_get_srcdir)/simple_u.out -s eq:1 \
23 diff -u -L input1 -L input2 "$(atf_get_srcdir)/input1.in" "$(atf_get_srcdir)/input2.in"
25 atf_check -o file:$(atf_get_srcdir)/simple_n.out -s eq:1 \
26 diff -n "$(atf_get_srcdir)/input1.in" "$(atf_get_srcdir)/input2.in"
28 atf_check -o inline:"Files $(atf_get_srcdir)/input1.in and $(atf_get_srcdir)/input2.in differ\n" -s eq:1 \
29 diff -q "$(atf_get_srcdir)/input1.in" "$(atf_get_srcdir)/input2.in"
32 diff -q "$(atf_get_srcdir)/input1.in" "$(atf_get_srcdir)/input1.in"
34 atf_check -o file:$(atf_get_srcdir)/simple_i.out -s eq:1 \
35 diff -i "$(atf_get_srcdir)/input_c1.in" "$(atf_get_srcdir)/input_c2.in"
37 atf_check -o file:$(atf_get_srcdir)/simple_w.out -s eq:1 \
38 diff -w "$(atf_get_srcdir)/input_c1.in" "$(atf_get_srcdir)/input_c2.in"
40 atf_check -o file:$(atf_get_srcdir)/simple_b.out -s eq:1 \
41 diff -b "$(atf_get_srcdir)/input_c1.in" "$(atf_get_srcdir)/input_c2.in"
43 atf_check -o file:$(atf_get_srcdir)/simple_p.out -s eq:1 \
44 diff --label input_c1.in --label input_c2.in -p "$(atf_get_srcdir)/input_c1.in" "$(atf_get_srcdir)/input_c2.in"
49 atf_check -o file:$(atf_get_srcdir)/unified_p.out -s eq:1 \
50 diff -up -L input_c1.in -L input_c2.in "$(atf_get_srcdir)/input_c1.in" "$(atf_get_srcdir)/input_c2.in"
51 atf_check -o file:$(atf_get_srcdir)/unified_c9999.out -s eq:1 \
52 diff -u -c9999 -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_expect_fail "--side-by-side not currently implemented (bug # 219933)"
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="A[[:space:]]+|[[:space:]]+D\nB[[:space:]]+B\nC[[:space:]]+|[[:space:]]+E"
112 exp_output_suppressed="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
169 atf_init_test_cases()
171 atf_add_test_case simple
172 atf_add_test_case unified
173 atf_add_test_case header
174 atf_add_test_case header_ns
175 atf_add_test_case ifdef
176 atf_add_test_case group_format
177 atf_add_test_case side_by_side
178 atf_add_test_case brief_format
179 atf_add_test_case b230049
180 atf_add_test_case Bflag