Blame


1 e9ce266e 2022-03-07 op #!/bin/sh
2 e9ce266e 2022-03-07 op #
3 e9ce266e 2022-03-07 op # Copyright (c) 2022 Omar Polo <op@openbsd.org>
4 e9ce266e 2022-03-07 op #
5 e9ce266e 2022-03-07 op # Permission to use, copy, modify, and distribute this software for any
6 e9ce266e 2022-03-07 op # purpose with or without fee is hereby granted, provided that the above
7 e9ce266e 2022-03-07 op # copyright notice and this permission notice appear in all copies.
8 e9ce266e 2022-03-07 op #
9 e9ce266e 2022-03-07 op # THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
10 e9ce266e 2022-03-07 op # WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
11 e9ce266e 2022-03-07 op # MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
12 e9ce266e 2022-03-07 op # ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
13 e9ce266e 2022-03-07 op # WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
14 e9ce266e 2022-03-07 op # ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
15 e9ce266e 2022-03-07 op # OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
16 e9ce266e 2022-03-07 op
17 e9ce266e 2022-03-07 op . ./common.sh
18 e9ce266e 2022-03-07 op
19 e9ce266e 2022-03-07 op test_patch_simple_add_file() {
20 e9ce266e 2022-03-07 op local testroot=`test_init patch_simple_add_file`
21 e9ce266e 2022-03-07 op
22 e9ce266e 2022-03-07 op got checkout $testroot/repo $testroot/wt > /dev/null
23 e9ce266e 2022-03-07 op ret=$?
24 bfbccd0a 2022-03-08 op if [ $ret -ne 0 ]; then
25 e9ce266e 2022-03-07 op test_done $testroot $ret
26 e9ce266e 2022-03-07 op return 1
27 e9ce266e 2022-03-07 op fi
28 e9ce266e 2022-03-07 op
29 e9ce266e 2022-03-07 op cat <<EOF > $testroot/wt/patch
30 e9ce266e 2022-03-07 op --- /dev/null
31 e9ce266e 2022-03-07 op +++ eta
32 e9ce266e 2022-03-07 op @@ -0,0 +1 @@
33 e9ce266e 2022-03-07 op +eta
34 e9ce266e 2022-03-07 op EOF
35 e9ce266e 2022-03-07 op
36 e9ce266e 2022-03-07 op (cd $testroot/wt && got patch patch) > $testroot/stdout
37 e9ce266e 2022-03-07 op ret=$?
38 bfbccd0a 2022-03-08 op if [ $ret -ne 0 ]; then
39 e9ce266e 2022-03-07 op test_done $testroot $ret
40 e9ce266e 2022-03-07 op return 1
41 e9ce266e 2022-03-07 op fi
42 e9ce266e 2022-03-07 op
43 e9ce266e 2022-03-07 op echo "A eta" > $testroot/stdout.expected
44 e9ce266e 2022-03-07 op cmp -s $testroot/stdout.expected $testroot/stdout
45 e9ce266e 2022-03-07 op ret=$?
46 bfbccd0a 2022-03-08 op if [ $ret -ne 0 ]; then
47 e9ce266e 2022-03-07 op diff -u $testroot/stdout.expected $testroot/stdout
48 e9ce266e 2022-03-07 op test_done $testroot $ret
49 e9ce266e 2022-03-07 op return 1
50 e9ce266e 2022-03-07 op fi
51 e9ce266e 2022-03-07 op
52 e9ce266e 2022-03-07 op echo eta > $testroot/wt/eta.expected
53 e9ce266e 2022-03-07 op cmp -s $testroot/wt/eta.expected $testroot/wt/eta
54 e9ce266e 2022-03-07 op ret=$?
55 bfbccd0a 2022-03-08 op if [ $ret -ne 0 ]; then
56 e9ce266e 2022-03-07 op diff -u $testroot/wt/eta.expected $testroot/wt/eta
57 e9ce266e 2022-03-07 op fi
58 e9ce266e 2022-03-07 op test_done $testroot $ret
59 e9ce266e 2022-03-07 op }
60 e9ce266e 2022-03-07 op
61 e9ce266e 2022-03-07 op test_patch_simple_rm_file() {
62 e9ce266e 2022-03-07 op local testroot=`test_init patch_simple_rm_file`
63 e9ce266e 2022-03-07 op
64 e9ce266e 2022-03-07 op got checkout $testroot/repo $testroot/wt > /dev/null
65 e9ce266e 2022-03-07 op ret=$?
66 bfbccd0a 2022-03-08 op if [ $ret -ne 0 ]; then
67 e9ce266e 2022-03-07 op test_done $testroot $ret
68 e9ce266e 2022-03-07 op return 1
69 e9ce266e 2022-03-07 op fi
70 e9ce266e 2022-03-07 op
71 e9ce266e 2022-03-07 op cat <<EOF > $testroot/wt/patch
72 e9ce266e 2022-03-07 op --- alpha
73 e9ce266e 2022-03-07 op +++ /dev/null
74 e9ce266e 2022-03-07 op @@ -1 +0,0 @@
75 e9ce266e 2022-03-07 op -alpha
76 e9ce266e 2022-03-07 op EOF
77 e9ce266e 2022-03-07 op
78 e9ce266e 2022-03-07 op echo "D alpha" > $testroot/stdout.expected
79 e9ce266e 2022-03-07 op
80 e9ce266e 2022-03-07 op (cd $testroot/wt && got patch patch) > $testroot/stdout
81 e9ce266e 2022-03-07 op ret=$?
82 bfbccd0a 2022-03-08 op if [ $ret -ne 0 ]; then
83 e9ce266e 2022-03-07 op test_done $testroot $ret
84 e9ce266e 2022-03-07 op return 1
85 e9ce266e 2022-03-07 op fi
86 e9ce266e 2022-03-07 op
87 e9ce266e 2022-03-07 op cmp -s $testroot/stdout.expected $testroot/stdout
88 e9ce266e 2022-03-07 op ret=$?
89 bfbccd0a 2022-03-08 op if [ $ret -ne 0 ]; then
90 e9ce266e 2022-03-07 op diff -u $testroot/stdout.expected $testroot/stdout
91 e9ce266e 2022-03-07 op test_done $testroot $ret
92 e9ce266e 2022-03-07 op return 1
93 e9ce266e 2022-03-07 op fi
94 e9ce266e 2022-03-07 op
95 e9ce266e 2022-03-07 op if [ -f $testroot/wt/alpha ]; then
96 e9ce266e 2022-03-07 op ret=1
97 e9ce266e 2022-03-07 op echo "alpha still exists!"
98 e9ce266e 2022-03-07 op fi
99 e9ce266e 2022-03-07 op test_done $testroot $ret
100 e9ce266e 2022-03-07 op }
101 e9ce266e 2022-03-07 op
102 e9ce266e 2022-03-07 op test_patch_simple_edit_file() {
103 e9ce266e 2022-03-07 op local testroot=`test_init patch_simple_edit_file`
104 e9ce266e 2022-03-07 op
105 e9ce266e 2022-03-07 op got checkout $testroot/repo $testroot/wt > /dev/null
106 e9ce266e 2022-03-07 op ret=$?
107 bfbccd0a 2022-03-08 op if [ $ret -ne 0 ]; then
108 e9ce266e 2022-03-07 op test_done $testroot $ret
109 e9ce266e 2022-03-07 op return 1
110 e9ce266e 2022-03-07 op fi
111 e9ce266e 2022-03-07 op
112 e9ce266e 2022-03-07 op cat <<EOF > $testroot/wt/patch
113 e9ce266e 2022-03-07 op --- alpha
114 e9ce266e 2022-03-07 op +++ alpha
115 e9ce266e 2022-03-07 op @@ -1 +1 @@
116 e9ce266e 2022-03-07 op -alpha
117 e9ce266e 2022-03-07 op +alpha is my favourite character
118 e9ce266e 2022-03-07 op EOF
119 e9ce266e 2022-03-07 op
120 e9ce266e 2022-03-07 op echo "M alpha" > $testroot/stdout.expected
121 e9ce266e 2022-03-07 op
122 e9ce266e 2022-03-07 op (cd $testroot/wt && got patch patch) > $testroot/stdout
123 e9ce266e 2022-03-07 op ret=$?
124 bfbccd0a 2022-03-08 op if [ $ret -ne 0 ]; then
125 e9ce266e 2022-03-07 op test_done $testroot $ret
126 e9ce266e 2022-03-07 op return 1
127 e9ce266e 2022-03-07 op fi
128 e9ce266e 2022-03-07 op
129 e9ce266e 2022-03-07 op cmp -s $testroot/stdout.expected $testroot/stdout
130 e9ce266e 2022-03-07 op ret=$?
131 bfbccd0a 2022-03-08 op if [ $ret -ne 0 ]; then
132 e9ce266e 2022-03-07 op diff -u $testroot/stdout.expected $testroot/stdout
133 e9ce266e 2022-03-07 op test_done $testroot $ret
134 e9ce266e 2022-03-07 op return 1
135 e9ce266e 2022-03-07 op fi
136 e9ce266e 2022-03-07 op
137 e9ce266e 2022-03-07 op echo 'alpha is my favourite character' > $testroot/wt/alpha.expected
138 e9ce266e 2022-03-07 op cmp -s $testroot/wt/alpha.expected $testroot/wt/alpha
139 e9ce266e 2022-03-07 op ret=$?
140 bfbccd0a 2022-03-08 op if [ $ret -ne 0 ]; then
141 e9ce266e 2022-03-07 op diff -u $testroot/wt/alpha.expected $testroot/wt/alpha
142 e9ce266e 2022-03-07 op fi
143 e9ce266e 2022-03-07 op test_done $testroot $ret
144 e9ce266e 2022-03-07 op }
145 e9ce266e 2022-03-07 op
146 e9ce266e 2022-03-07 op test_patch_prepend_line() {
147 e9ce266e 2022-03-07 op local testroot=`test_init patch_prepend_line`
148 e9ce266e 2022-03-07 op
149 e9ce266e 2022-03-07 op got checkout $testroot/repo $testroot/wt > /dev/null
150 e9ce266e 2022-03-07 op ret=$?
151 bfbccd0a 2022-03-08 op if [ $ret -ne 0 ]; then
152 e9ce266e 2022-03-07 op test_done $testroot $ret
153 e9ce266e 2022-03-07 op return 1
154 e9ce266e 2022-03-07 op fi
155 e9ce266e 2022-03-07 op
156 e9ce266e 2022-03-07 op cat <<EOF > $testroot/wt/patch
157 e9ce266e 2022-03-07 op --- alpha
158 e9ce266e 2022-03-07 op +++ alpha
159 e9ce266e 2022-03-07 op @@ -1 +1,2 @@
160 e9ce266e 2022-03-07 op +hatsuseno
161 e9ce266e 2022-03-07 op alpha
162 e9ce266e 2022-03-07 op EOF
163 e9ce266e 2022-03-07 op
164 e9ce266e 2022-03-07 op echo "M alpha" > $testroot/stdout.expected
165 e9ce266e 2022-03-07 op
166 e9ce266e 2022-03-07 op (cd $testroot/wt && got patch patch) > $testroot/stdout
167 e9ce266e 2022-03-07 op ret=$?
168 bfbccd0a 2022-03-08 op if [ $ret -ne 0 ]; then
169 e9ce266e 2022-03-07 op test_done $testroot $ret
170 e9ce266e 2022-03-07 op return 1
171 e9ce266e 2022-03-07 op fi
172 e9ce266e 2022-03-07 op
173 e9ce266e 2022-03-07 op cmp -s $testroot/stdout.expected $testroot/stdout
174 e9ce266e 2022-03-07 op ret=$?
175 bfbccd0a 2022-03-08 op if [ $ret -ne 0 ]; then
176 e9ce266e 2022-03-07 op diff -u $testroot/stdout.expected $testroot/stdout
177 e9ce266e 2022-03-07 op test_done $testroot $ret
178 e9ce266e 2022-03-07 op return 1
179 e9ce266e 2022-03-07 op fi
180 e9ce266e 2022-03-07 op
181 e9ce266e 2022-03-07 op echo hatsuseno > $testroot/wt/alpha.expected
182 e9ce266e 2022-03-07 op echo alpha >> $testroot/wt/alpha.expected
183 e9ce266e 2022-03-07 op cmp -s $testroot/wt/alpha.expected $testroot/wt/alpha
184 e9ce266e 2022-03-07 op ret=$?
185 bfbccd0a 2022-03-08 op if [ $ret -ne 0 ]; then
186 e9ce266e 2022-03-07 op diff -u $testroot/wt/alpha.expected $testroot/wt/alpha
187 e9ce266e 2022-03-07 op fi
188 e9ce266e 2022-03-07 op test_done $testroot $ret
189 e9ce266e 2022-03-07 op }
190 e9ce266e 2022-03-07 op
191 e9ce266e 2022-03-07 op test_patch_replace_line() {
192 e9ce266e 2022-03-07 op local testroot=`test_init patch_replace_line`
193 e9ce266e 2022-03-07 op
194 e9ce266e 2022-03-07 op got checkout $testroot/repo $testroot/wt > /dev/null
195 e9ce266e 2022-03-07 op ret=$?
196 bfbccd0a 2022-03-08 op if [ $ret -ne 0 ]; then
197 e9ce266e 2022-03-07 op test_done $testroot $ret
198 e9ce266e 2022-03-07 op return 1
199 e9ce266e 2022-03-07 op fi
200 e9ce266e 2022-03-07 op
201 e9ce266e 2022-03-07 op jot 10 > $testroot/wt/numbers
202 e9ce266e 2022-03-07 op (cd $testroot/wt/ && got add numbers && got ci -m 'add numbers') \
203 e9ce266e 2022-03-07 op >/dev/null
204 e9ce266e 2022-03-07 op ret=$?
205 bfbccd0a 2022-03-08 op if [ $ret -ne 0 ]; then
206 e9ce266e 2022-03-07 op test_done $testroot $ret
207 e9ce266e 2022-03-07 op return 1
208 e9ce266e 2022-03-07 op fi
209 e9ce266e 2022-03-07 op
210 e9ce266e 2022-03-07 op cat <<EOF > $testroot/wt/patch
211 e9ce266e 2022-03-07 op --- numbers
212 e9ce266e 2022-03-07 op +++ numbers
213 e9ce266e 2022-03-07 op @@ -3,7 +3,7 @@
214 e9ce266e 2022-03-07 op 3
215 e9ce266e 2022-03-07 op 4
216 e9ce266e 2022-03-07 op 5
217 e9ce266e 2022-03-07 op -6
218 e9ce266e 2022-03-07 op +foo
219 e9ce266e 2022-03-07 op 7
220 e9ce266e 2022-03-07 op 8
221 e9ce266e 2022-03-07 op 9
222 e9ce266e 2022-03-07 op EOF
223 e9ce266e 2022-03-07 op
224 e9ce266e 2022-03-07 op echo "M numbers" > $testroot/stdout.expected
225 e9ce266e 2022-03-07 op
226 e9ce266e 2022-03-07 op (cd $testroot/wt && got patch patch) > $testroot/stdout
227 e9ce266e 2022-03-07 op ret=$?
228 bfbccd0a 2022-03-08 op if [ $ret -ne 0 ]; then
229 e9ce266e 2022-03-07 op test_done $testroot $ret
230 e9ce266e 2022-03-07 op return 1
231 e9ce266e 2022-03-07 op fi
232 e9ce266e 2022-03-07 op
233 e9ce266e 2022-03-07 op cmp -s $testroot/stdout.expected $testroot/stdout
234 e9ce266e 2022-03-07 op ret=$?
235 bfbccd0a 2022-03-08 op if [ $ret -ne 0 ]; then
236 e9ce266e 2022-03-07 op diff -u $testroot/stdout.expected $testroot/stdout
237 e9ce266e 2022-03-07 op test_done $testroot $ret
238 e9ce266e 2022-03-07 op return 1
239 e9ce266e 2022-03-07 op fi
240 e9ce266e 2022-03-07 op
241 e9ce266e 2022-03-07 op jot 10 | sed 's/6/foo/' > $testroot/wt/numbers.expected
242 e9ce266e 2022-03-07 op cmp -s $testroot/wt/numbers.expected $testroot/wt/numbers
243 e9ce266e 2022-03-07 op ret=$?
244 bfbccd0a 2022-03-08 op if [ $ret -ne 0 ]; then
245 e9ce266e 2022-03-07 op diff -u $testroot/wt/numbers.expected $testroot/wt/numbers
246 e9ce266e 2022-03-07 op fi
247 e9ce266e 2022-03-07 op test_done $testroot $ret
248 e9ce266e 2022-03-07 op }
249 e9ce266e 2022-03-07 op
250 e9ce266e 2022-03-07 op test_patch_multiple_hunks() {
251 fd79e2e0 2022-03-08 op local testroot=`test_init patch_replace_multiple_hunks`
252 e9ce266e 2022-03-07 op
253 e9ce266e 2022-03-07 op got checkout $testroot/repo $testroot/wt > /dev/null
254 e9ce266e 2022-03-07 op ret=$?
255 bfbccd0a 2022-03-08 op if [ $ret -ne 0 ]; then
256 e9ce266e 2022-03-07 op test_done $testroot $ret
257 e9ce266e 2022-03-07 op return 1
258 e9ce266e 2022-03-07 op fi
259 e9ce266e 2022-03-07 op
260 e9ce266e 2022-03-07 op jot 100 > $testroot/wt/numbers
261 e9ce266e 2022-03-07 op (cd $testroot/wt/ && got add numbers && got ci -m 'add numbers') \
262 e9ce266e 2022-03-07 op >/dev/null
263 e9ce266e 2022-03-07 op ret=$?
264 bfbccd0a 2022-03-08 op if [ $ret -ne 0 ]; then
265 e9ce266e 2022-03-07 op test_done $testroot $ret
266 e9ce266e 2022-03-07 op return 1
267 e9ce266e 2022-03-07 op fi
268 e9ce266e 2022-03-07 op
269 e9ce266e 2022-03-07 op cat <<EOF > $testroot/wt/patch
270 e9ce266e 2022-03-07 op --- numbers
271 e9ce266e 2022-03-07 op +++ numbers
272 e9ce266e 2022-03-07 op @@ -3,7 +3,7 @@
273 e9ce266e 2022-03-07 op 3
274 e9ce266e 2022-03-07 op 4
275 e9ce266e 2022-03-07 op 5
276 e9ce266e 2022-03-07 op -6
277 e9ce266e 2022-03-07 op +foo
278 e9ce266e 2022-03-07 op 7
279 e9ce266e 2022-03-07 op 8
280 e9ce266e 2022-03-07 op 9
281 e9ce266e 2022-03-07 op @@ -57,7 +57,7 @@
282 e9ce266e 2022-03-07 op 57
283 e9ce266e 2022-03-07 op 58
284 e9ce266e 2022-03-07 op 59
285 e9ce266e 2022-03-07 op -60
286 e9ce266e 2022-03-07 op +foo foo
287 e9ce266e 2022-03-07 op 61
288 e9ce266e 2022-03-07 op 62
289 e9ce266e 2022-03-07 op 63
290 e9ce266e 2022-03-07 op @@ -98,3 +98,6 @@
291 e9ce266e 2022-03-07 op 98
292 e9ce266e 2022-03-07 op 99
293 e9ce266e 2022-03-07 op 100
294 e9ce266e 2022-03-07 op +101
295 e9ce266e 2022-03-07 op +102
296 e9ce266e 2022-03-07 op +...
297 e9ce266e 2022-03-07 op EOF
298 e9ce266e 2022-03-07 op
299 e9ce266e 2022-03-07 op echo "M numbers" > $testroot/stdout.expected
300 e9ce266e 2022-03-07 op
301 e9ce266e 2022-03-07 op (cd $testroot/wt && got patch patch) > $testroot/stdout
302 e9ce266e 2022-03-07 op ret=$?
303 bfbccd0a 2022-03-08 op if [ $ret -ne 0 ]; then
304 e9ce266e 2022-03-07 op test_done $testroot $ret
305 e9ce266e 2022-03-07 op return 1
306 e9ce266e 2022-03-07 op fi
307 e9ce266e 2022-03-07 op
308 e9ce266e 2022-03-07 op cmp -s $testroot/stdout.expected $testroot/stdout
309 e9ce266e 2022-03-07 op ret=$?
310 bfbccd0a 2022-03-08 op if [ $ret -ne 0 ]; then
311 e9ce266e 2022-03-07 op diff -u $testroot/stdout.expected $testroot/stdout
312 e9ce266e 2022-03-07 op test_done $testroot $ret
313 e9ce266e 2022-03-07 op return 1
314 e9ce266e 2022-03-07 op fi
315 e9ce266e 2022-03-07 op
316 e9ce266e 2022-03-07 op jot 100 | sed -e 's/^6$/foo/' -e 's/^60$/foo foo/' \
317 e9ce266e 2022-03-07 op > $testroot/wt/numbers.expected
318 e9ce266e 2022-03-07 op echo "101" >> $testroot/wt/numbers.expected
319 e9ce266e 2022-03-07 op echo "102" >> $testroot/wt/numbers.expected
320 e9ce266e 2022-03-07 op echo "..." >> $testroot/wt/numbers.expected
321 e9ce266e 2022-03-07 op
322 e9ce266e 2022-03-07 op cmp -s $testroot/wt/numbers.expected $testroot/wt/numbers
323 e9ce266e 2022-03-07 op ret=$?
324 bfbccd0a 2022-03-08 op if [ $ret -ne 0 ]; then
325 e9ce266e 2022-03-07 op diff -u $testroot/wt/numbers.expected $testroot/wt/numbers
326 e9ce266e 2022-03-07 op fi
327 e9ce266e 2022-03-07 op test_done $testroot $ret
328 e9ce266e 2022-03-07 op }
329 e9ce266e 2022-03-07 op
330 e9ce266e 2022-03-07 op test_patch_multiple_files() {
331 e9ce266e 2022-03-07 op local testroot=`test_init patch_multiple_files`
332 e9ce266e 2022-03-07 op
333 e9ce266e 2022-03-07 op got checkout $testroot/repo $testroot/wt > /dev/null
334 e9ce266e 2022-03-07 op ret=$?
335 bfbccd0a 2022-03-08 op if [ $ret -ne 0 ]; then
336 e9ce266e 2022-03-07 op test_done $testroot $ret
337 e9ce266e 2022-03-07 op return 1
338 e9ce266e 2022-03-07 op fi
339 e9ce266e 2022-03-07 op
340 e9ce266e 2022-03-07 op cat <<EOF > $testroot/wt/patch
341 e9ce266e 2022-03-07 op --- alpha Mon Mar 7 19:02:07 2022
342 e9ce266e 2022-03-07 op +++ alpha Mon Mar 7 19:01:53 2022
343 e9ce266e 2022-03-07 op @@ -1 +1,3 @@
344 e9ce266e 2022-03-07 op +new
345 e9ce266e 2022-03-07 op alpha
346 e9ce266e 2022-03-07 op +available
347 e9ce266e 2022-03-07 op --- beta Mon Mar 7 19:02:11 2022
348 e9ce266e 2022-03-07 op +++ beta Mon Mar 7 19:01:46 2022
349 e9ce266e 2022-03-07 op @@ -1 +1,3 @@
350 e9ce266e 2022-03-07 op beta
351 e9ce266e 2022-03-07 op +was
352 e9ce266e 2022-03-07 op +improved
353 e9ce266e 2022-03-07 op --- gamma/delta Mon Mar 7 19:02:17 2022
354 e9ce266e 2022-03-07 op +++ gamma/delta Mon Mar 7 19:01:37 2022
355 e9ce266e 2022-03-07 op @@ -1 +1 @@
356 e9ce266e 2022-03-07 op -delta
357 e9ce266e 2022-03-07 op +delta new
358 e9ce266e 2022-03-07 op EOF
359 e9ce266e 2022-03-07 op
360 e9ce266e 2022-03-07 op echo "M alpha" > $testroot/stdout.expected
361 e9ce266e 2022-03-07 op echo "M beta" >> $testroot/stdout.expected
362 e9ce266e 2022-03-07 op echo "M gamma/delta" >> $testroot/stdout.expected
363 e9ce266e 2022-03-07 op
364 e9ce266e 2022-03-07 op (cd $testroot/wt && got patch patch) > $testroot/stdout
365 e9ce266e 2022-03-07 op ret=$?
366 bfbccd0a 2022-03-08 op if [ $ret -ne 0 ]; then
367 fd79e2e0 2022-03-08 op test_done $testroot $ret
368 e9ce266e 2022-03-07 op return 1
369 e9ce266e 2022-03-07 op fi
370 e9ce266e 2022-03-07 op
371 e9ce266e 2022-03-07 op cmp -s $testroot/stdout.expected $testroot/stdout
372 e9ce266e 2022-03-07 op ret=$?
373 bfbccd0a 2022-03-08 op if [ $ret -ne 0 ]; then
374 e9ce266e 2022-03-07 op diff -u $testroot/stdout.expected $testroot/stdout
375 e9ce266e 2022-03-07 op test_done $testroot $ret
376 e9ce266e 2022-03-07 op return 1
377 e9ce266e 2022-03-07 op fi
378 e9ce266e 2022-03-07 op
379 e9ce266e 2022-03-07 op printf 'new\nalpha\navailable\n' > $testroot/wt/alpha.expected
380 e9ce266e 2022-03-07 op printf 'beta\nwas\nimproved\n' > $testroot/wt/beta.expected
381 e9ce266e 2022-03-07 op printf 'delta new\n' > $testroot/wt/gamma/delta.expected
382 e9ce266e 2022-03-07 op
383 e9ce266e 2022-03-07 op for f in alpha beta gamma/delta; do
384 e9ce266e 2022-03-07 op cmp -s $testroot/wt/$f.expected $testroot/wt/$f
385 e9ce266e 2022-03-07 op ret=$?
386 bfbccd0a 2022-03-08 op if [ $ret -ne 0 ]; then
387 e9ce266e 2022-03-07 op diff -u $testroot/wt/$f.expected $testroot/wt/$f
388 e9ce266e 2022-03-07 op test_done $testroot $ret
389 e9ce266e 2022-03-07 op return 1
390 e9ce266e 2022-03-07 op fi
391 e9ce266e 2022-03-07 op done
392 e9ce266e 2022-03-07 op
393 e9ce266e 2022-03-07 op test_done $testroot 0
394 e9ce266e 2022-03-07 op }
395 e9ce266e 2022-03-07 op
396 e9ce266e 2022-03-07 op test_patch_dont_apply() {
397 e9ce266e 2022-03-07 op local testroot=`test_init patch_dont_apply`
398 e9ce266e 2022-03-07 op
399 e9ce266e 2022-03-07 op got checkout $testroot/repo $testroot/wt > /dev/null
400 e9ce266e 2022-03-07 op ret=$?
401 bfbccd0a 2022-03-08 op if [ $ret -ne 0 ]; then
402 e9ce266e 2022-03-07 op test_done $testroot $ret
403 e9ce266e 2022-03-07 op return 1
404 e9ce266e 2022-03-07 op fi
405 e9ce266e 2022-03-07 op
406 5b67f96e 2022-03-13 op jot 100 > $testroot/wt/numbers
407 5b67f96e 2022-03-13 op (cd $testroot/wt && got add numbers && got commit -m 'add numbers') \
408 5b67f96e 2022-03-13 op >/dev/null
409 5b67f96e 2022-03-13 op ret=$?
410 5b67f96e 2022-03-13 op if [ $ret -ne 0 ]; then
411 5b67f96e 2022-03-13 op test_done $testroot $ret
412 5b67f96e 2022-03-13 op return 1
413 5b67f96e 2022-03-13 op fi
414 5b67f96e 2022-03-13 op
415 5b67f96e 2022-03-13 op cat <<EOF > $testroot/wt/patch
416 60aa1fa0 2022-03-17 op --- alpha
417 60aa1fa0 2022-03-17 op +++ alpha
418 60aa1fa0 2022-03-17 op @@ -1 +1,2 @@
419 60aa1fa0 2022-03-17 op +hatsuseno
420 60aa1fa0 2022-03-17 op alpha something
421 5b67f96e 2022-03-13 op --- numbers
422 5b67f96e 2022-03-13 op +++ /dev/null
423 5b67f96e 2022-03-13 op @@ -1,9 +0,0 @@
424 5b67f96e 2022-03-13 op -1
425 5b67f96e 2022-03-13 op -2
426 5b67f96e 2022-03-13 op -3
427 5b67f96e 2022-03-13 op -4
428 5b67f96e 2022-03-13 op -5
429 5b67f96e 2022-03-13 op -6
430 5b67f96e 2022-03-13 op -7
431 5b67f96e 2022-03-13 op -8
432 5b67f96e 2022-03-13 op -9
433 5b67f96e 2022-03-13 op EOF
434 5b67f96e 2022-03-13 op
435 60aa1fa0 2022-03-17 op (cd $testroot/wt && got patch patch) > $testroot/stdout 2> /dev/null
436 5b67f96e 2022-03-13 op ret=$?
437 5b67f96e 2022-03-13 op if [ $ret -eq 0 ]; then # should fail
438 5b67f96e 2022-03-13 op test_done $testroot 1
439 e9ce266e 2022-03-07 op return 1
440 e9ce266e 2022-03-07 op fi
441 e9ce266e 2022-03-07 op
442 60aa1fa0 2022-03-17 op cat <<EOF > $testroot/stdout.expected
443 60aa1fa0 2022-03-17 op # alpha
444 60aa1fa0 2022-03-17 op @@ -1,1 +1,2 @@ hunk failed to apply
445 60aa1fa0 2022-03-17 op # numbers
446 60aa1fa0 2022-03-17 op @@ -1,9 +0,0 @@ hunk failed to apply
447 60aa1fa0 2022-03-17 op EOF
448 60aa1fa0 2022-03-17 op
449 60aa1fa0 2022-03-17 op cmp -s $testroot/stdout.expected $testroot/stdout
450 5b67f96e 2022-03-13 op ret=$?
451 5b67f96e 2022-03-13 op if [ $ret -ne 0 ]; then
452 60aa1fa0 2022-03-17 op diff -u $testroot/stdout.expected $testroot/stdout
453 5b67f96e 2022-03-13 op fi
454 e9ce266e 2022-03-07 op test_done $testroot $ret
455 e9ce266e 2022-03-07 op }
456 e9ce266e 2022-03-07 op
457 e9ce266e 2022-03-07 op test_patch_malformed() {
458 e9ce266e 2022-03-07 op local testroot=`test_init patch_malformed`
459 e9ce266e 2022-03-07 op
460 e9ce266e 2022-03-07 op got checkout $testroot/repo $testroot/wt > /dev/null
461 e9ce266e 2022-03-07 op ret=$?
462 bfbccd0a 2022-03-08 op if [ $ret -ne 0 ]; then
463 e9ce266e 2022-03-07 op test_done $testroot $ret
464 e9ce266e 2022-03-07 op return 1
465 e9ce266e 2022-03-07 op fi
466 e9ce266e 2022-03-07 op
467 e9ce266e 2022-03-07 op # missing "@@"
468 e9ce266e 2022-03-07 op cat <<EOF > $testroot/wt/patch
469 e9ce266e 2022-03-07 op --- alpha
470 e9ce266e 2022-03-07 op +++ alpha
471 e9ce266e 2022-03-07 op @@ -1 +1,2
472 e9ce266e 2022-03-07 op +hatsuseno
473 e9ce266e 2022-03-07 op alpha
474 e9ce266e 2022-03-07 op EOF
475 e9ce266e 2022-03-07 op
476 e9ce266e 2022-03-07 op echo -n > $testroot/stdout.expected
477 e9ce266e 2022-03-07 op echo "got: malformed patch" > $testroot/stderr.expected
478 e9ce266e 2022-03-07 op
479 e9ce266e 2022-03-07 op (cd $testroot/wt && got patch patch) \
480 e9ce266e 2022-03-07 op > $testroot/stdout \
481 e9ce266e 2022-03-07 op 2> $testroot/stderr
482 e9ce266e 2022-03-07 op ret=$?
483 bfbccd0a 2022-03-08 op if [ $ret -eq 0 ]; then
484 e9ce266e 2022-03-07 op echo "got managed to apply an invalid patch"
485 e9ce266e 2022-03-07 op test_done $testroot 1
486 e9ce266e 2022-03-07 op return 1
487 e9ce266e 2022-03-07 op fi
488 e9ce266e 2022-03-07 op
489 e9ce266e 2022-03-07 op cmp -s $testroot/stdout.expected $testroot/stdout
490 e9ce266e 2022-03-07 op ret=$?
491 bfbccd0a 2022-03-08 op if [ $ret -ne 0 ]; then
492 e9ce266e 2022-03-07 op diff -u $testroot/stdout.expected $testroot/stdout
493 e9ce266e 2022-03-07 op test_done $testroot $ret
494 e9ce266e 2022-03-07 op return 1
495 e9ce266e 2022-03-07 op fi
496 e9ce266e 2022-03-07 op
497 e9ce266e 2022-03-07 op cmp -s $testroot/stderr.expected $testroot/stderr
498 e9ce266e 2022-03-07 op ret=$?
499 bfbccd0a 2022-03-08 op if [ $ret -ne 0 ]; then
500 e9ce266e 2022-03-07 op diff -u $testroot/stderr.expected $testroot/stderr
501 e9ce266e 2022-03-07 op test_done $testroot $ret
502 e9ce266e 2022-03-07 op return 1
503 e9ce266e 2022-03-07 op fi
504 e9ce266e 2022-03-07 op
505 e9ce266e 2022-03-07 op # wrong first character
506 e9ce266e 2022-03-07 op cat <<EOF > $testroot/wt/patch
507 e9ce266e 2022-03-07 op --- alpha
508 e9ce266e 2022-03-07 op +++ alpha
509 e9ce266e 2022-03-07 op @@ -1 +1,2 @@
510 e9ce266e 2022-03-07 op +hatsuseno
511 e9ce266e 2022-03-07 op alpha
512 be33dff7 2022-05-13 op EOF
513 be33dff7 2022-05-13 op
514 be33dff7 2022-05-13 op (cd $testroot/wt && got patch patch) \
515 be33dff7 2022-05-13 op > $testroot/stdout \
516 be33dff7 2022-05-13 op 2> $testroot/stderr
517 be33dff7 2022-05-13 op ret=$?
518 be33dff7 2022-05-13 op if [ $ret -eq 0 ]; then
519 be33dff7 2022-05-13 op echo "got managed to apply an invalid patch"
520 be33dff7 2022-05-13 op test_done $testroot 1
521 be33dff7 2022-05-13 op return 1
522 be33dff7 2022-05-13 op fi
523 be33dff7 2022-05-13 op
524 be33dff7 2022-05-13 op cmp -s $testroot/stdout.expected $testroot/stdout
525 be33dff7 2022-05-13 op ret=$?
526 be33dff7 2022-05-13 op if [ $ret -ne 0 ]; then
527 be33dff7 2022-05-13 op diff -u $testroot/stdout.expected $testroot/stdout
528 be33dff7 2022-05-13 op test_done $testroot $ret
529 be33dff7 2022-05-13 op return 1
530 be33dff7 2022-05-13 op fi
531 be33dff7 2022-05-13 op
532 be33dff7 2022-05-13 op cmp -s $testroot/stderr.expected $testroot/stderr
533 be33dff7 2022-05-13 op ret=$?
534 be33dff7 2022-05-13 op if [ $ret -ne 0 ]; then
535 be33dff7 2022-05-13 op diff -u $testroot/stderr.expected $testroot/stderr
536 be33dff7 2022-05-13 op test_done $testroot $ret
537 be33dff7 2022-05-13 op return 1
538 be33dff7 2022-05-13 op fi
539 be33dff7 2022-05-13 op
540 be33dff7 2022-05-13 op # empty hunk
541 be33dff7 2022-05-13 op cat <<EOF > $testroot/wt/patch
542 be33dff7 2022-05-13 op diff --git a/alpha b/iota
543 be33dff7 2022-05-13 op --- a/alpha
544 be33dff7 2022-05-13 op +++ b/iota
545 be33dff7 2022-05-13 op @@ -0,0 +0,0 @@
546 e9ce266e 2022-03-07 op EOF
547 e9ce266e 2022-03-07 op
548 e9ce266e 2022-03-07 op (cd $testroot/wt && got patch patch) \
549 e9ce266e 2022-03-07 op > $testroot/stdout \
550 e9ce266e 2022-03-07 op 2> $testroot/stderr
551 e9ce266e 2022-03-07 op ret=$?
552 bfbccd0a 2022-03-08 op if [ $ret -eq 0 ]; then
553 e9ce266e 2022-03-07 op echo "got managed to apply an invalid patch"
554 e9ce266e 2022-03-07 op test_done $testroot 1
555 e9ce266e 2022-03-07 op return 1
556 e9ce266e 2022-03-07 op fi
557 e9ce266e 2022-03-07 op
558 e9ce266e 2022-03-07 op cmp -s $testroot/stdout.expected $testroot/stdout
559 e9ce266e 2022-03-07 op ret=$?
560 bfbccd0a 2022-03-08 op if [ $ret -ne 0 ]; then
561 e9ce266e 2022-03-07 op diff -u $testroot/stdout.expected $testroot/stdout
562 e9ce266e 2022-03-07 op test_done $testroot $ret
563 e9ce266e 2022-03-07 op return 1
564 e9ce266e 2022-03-07 op fi
565 e9ce266e 2022-03-07 op
566 e9ce266e 2022-03-07 op cmp -s $testroot/stderr.expected $testroot/stderr
567 e9ce266e 2022-03-07 op ret=$?
568 bfbccd0a 2022-03-08 op if [ $ret -ne 0 ]; then
569 e9ce266e 2022-03-07 op diff -u $testroot/stderr.expected $testroot/stderr
570 e9ce266e 2022-03-07 op test_done $testroot $ret
571 e9ce266e 2022-03-07 op return 1
572 e9ce266e 2022-03-07 op fi
573 e9ce266e 2022-03-07 op
574 e9ce266e 2022-03-07 op test_done $testroot $ret
575 e9ce266e 2022-03-07 op }
576 e9ce266e 2022-03-07 op
577 e9ce266e 2022-03-07 op test_patch_no_patch() {
578 e9ce266e 2022-03-07 op local testroot=`test_init patch_no_patch`
579 e9ce266e 2022-03-07 op
580 e9ce266e 2022-03-07 op got checkout $testroot/repo $testroot/wt > /dev/null
581 e9ce266e 2022-03-07 op ret=$?
582 bfbccd0a 2022-03-08 op if [ $ret -ne 0 ]; then
583 e9ce266e 2022-03-07 op test_done $testroot $ret
584 e9ce266e 2022-03-07 op return 1
585 e9ce266e 2022-03-07 op fi
586 e9ce266e 2022-03-07 op
587 e9ce266e 2022-03-07 op cat <<EOF > $testroot/wt/patch
588 e9ce266e 2022-03-07 op hello world!
589 e9ce266e 2022-03-07 op ...
590 e9ce266e 2022-03-07 op
591 e9ce266e 2022-03-07 op some other nonsense
592 e9ce266e 2022-03-07 op ...
593 e9ce266e 2022-03-07 op
594 e9ce266e 2022-03-07 op there's no patch in here!
595 e9ce266e 2022-03-07 op EOF
596 e9ce266e 2022-03-07 op
597 e9ce266e 2022-03-07 op echo -n > $testroot/stdout.expected
598 e9ce266e 2022-03-07 op echo "got: no patch found" > $testroot/stderr.expected
599 e9ce266e 2022-03-07 op
600 e9ce266e 2022-03-07 op (cd $testroot/wt && got patch patch) \
601 e9ce266e 2022-03-07 op > $testroot/stdout \
602 e9ce266e 2022-03-07 op 2> $testroot/stderr
603 e9ce266e 2022-03-07 op ret=$?
604 bfbccd0a 2022-03-08 op if [ $ret -eq 0 ]; then # should fail
605 e9ce266e 2022-03-07 op test_done $testroot 1
606 e9ce266e 2022-03-07 op return 1
607 e9ce266e 2022-03-07 op fi
608 3313bcd8 2022-04-19 op
609 e9ce266e 2022-03-07 op cmp -s $testroot/stdout.expected $testroot/stdout
610 e9ce266e 2022-03-07 op ret=$?
611 bfbccd0a 2022-03-08 op if [ $ret -ne 0 ]; then
612 e9ce266e 2022-03-07 op diff -u $testroot/stdout.expected $testroot/stdout
613 e9ce266e 2022-03-07 op test_done $testroot $ret
614 e9ce266e 2022-03-07 op return 1
615 e9ce266e 2022-03-07 op fi
616 e9ce266e 2022-03-07 op
617 e9ce266e 2022-03-07 op cmp -s $testroot/stderr.expected $testroot/stderr
618 e9ce266e 2022-03-07 op ret=$?
619 bfbccd0a 2022-03-08 op if [ $ret -ne 0 ]; then
620 e9ce266e 2022-03-07 op diff -u $testroot/stderr.expected $testroot/stderr
621 e9ce266e 2022-03-07 op test_done $testroot $ret
622 e9ce266e 2022-03-07 op return 1
623 e9ce266e 2022-03-07 op fi
624 e9ce266e 2022-03-07 op
625 e9ce266e 2022-03-07 op test_done $testroot $ret
626 e9ce266e 2022-03-07 op }
627 e9ce266e 2022-03-07 op
628 e9ce266e 2022-03-07 op test_patch_equals_for_context() {
629 f1d6cebb 2022-04-23 op local testroot=`test_init patch_equals_for_context`
630 e9ce266e 2022-03-07 op
631 e9ce266e 2022-03-07 op got checkout $testroot/repo $testroot/wt > /dev/null
632 e9ce266e 2022-03-07 op ret=$?
633 bfbccd0a 2022-03-08 op if [ $ret -ne 0 ]; then
634 e9ce266e 2022-03-07 op test_done $testroot $ret
635 e9ce266e 2022-03-07 op return 1
636 e9ce266e 2022-03-07 op fi
637 e9ce266e 2022-03-07 op
638 e9ce266e 2022-03-07 op cat <<EOF > $testroot/wt/patch
639 e9ce266e 2022-03-07 op --- alpha
640 e9ce266e 2022-03-07 op +++ alpha
641 e9ce266e 2022-03-07 op @@ -1 +1,2 @@
642 e9ce266e 2022-03-07 op +hatsuseno
643 e9ce266e 2022-03-07 op =alpha
644 e9ce266e 2022-03-07 op EOF
645 e9ce266e 2022-03-07 op
646 e9ce266e 2022-03-07 op echo "M alpha" > $testroot/stdout.expected
647 e9ce266e 2022-03-07 op
648 e9ce266e 2022-03-07 op (cd $testroot/wt && got patch patch) > $testroot/stdout
649 e9ce266e 2022-03-07 op ret=$?
650 bfbccd0a 2022-03-08 op if [ $ret -ne 0 ]; then
651 e9ce266e 2022-03-07 op test_done $testroot $ret
652 e9ce266e 2022-03-07 op return 1
653 e9ce266e 2022-03-07 op fi
654 e9ce266e 2022-03-07 op
655 e9ce266e 2022-03-07 op cmp -s $testroot/stdout.expected $testroot/stdout
656 e9ce266e 2022-03-07 op ret=$?
657 bfbccd0a 2022-03-08 op if [ $ret -ne 0 ]; then
658 e9ce266e 2022-03-07 op diff -u $testroot/stdout.expected $testroot/stdout
659 e9ce266e 2022-03-07 op test_done $testroot $ret
660 e9ce266e 2022-03-07 op return 1
661 e9ce266e 2022-03-07 op fi
662 e9ce266e 2022-03-07 op
663 e9ce266e 2022-03-07 op echo hatsuseno > $testroot/wt/alpha.expected
664 e9ce266e 2022-03-07 op echo alpha >> $testroot/wt/alpha.expected
665 e9ce266e 2022-03-07 op cmp -s $testroot/wt/alpha.expected $testroot/wt/alpha
666 e9ce266e 2022-03-07 op ret=$?
667 bfbccd0a 2022-03-08 op if [ $ret -ne 0 ]; then
668 e9ce266e 2022-03-07 op diff -u $testroot/wt/alpha.expected $testroot/wt/alpha
669 e9ce266e 2022-03-07 op fi
670 e9ce266e 2022-03-07 op test_done $testroot $ret
671 e9ce266e 2022-03-07 op }
672 6e96b326 2022-03-12 op
673 6e96b326 2022-03-12 op test_patch_rename() {
674 6e96b326 2022-03-12 op local testroot=`test_init patch_rename`
675 6e96b326 2022-03-12 op
676 6e96b326 2022-03-12 op got checkout $testroot/repo $testroot/wt > /dev/null
677 6e96b326 2022-03-12 op ret=$?
678 6e96b326 2022-03-12 op if [ $ret -ne 0 ]; then
679 6e96b326 2022-03-12 op test_done $testroot $ret
680 6e96b326 2022-03-12 op return 1
681 6e96b326 2022-03-12 op fi
682 6e96b326 2022-03-12 op
683 6e96b326 2022-03-12 op cat <<EOF > $testroot/wt/patch
684 4379a9aa 2022-05-02 op diff --git a/beta b/iota
685 4379a9aa 2022-05-02 op similarity index 100%
686 4379a9aa 2022-05-02 op rename from beta
687 4379a9aa 2022-05-02 op rename to iota
688 7a30b5cb 2022-03-20 op diff --git a/alpha b/eta
689 7a30b5cb 2022-03-20 op --- a/alpha
690 7a30b5cb 2022-03-20 op +++ b/eta
691 4379a9aa 2022-05-02 op @@ -1 +1 @@
692 4379a9aa 2022-05-02 op -alpha
693 4379a9aa 2022-05-02 op +eta
694 6e96b326 2022-03-12 op EOF
695 e9ce266e 2022-03-07 op
696 4379a9aa 2022-05-02 op echo 'D beta' > $testroot/stdout.expected
697 4379a9aa 2022-05-02 op echo 'A iota' >> $testroot/stdout.expected
698 4379a9aa 2022-05-02 op echo 'D alpha' >> $testroot/stdout.expected
699 4379a9aa 2022-05-02 op echo 'A eta' >> $testroot/stdout.expected
700 6e96b326 2022-03-12 op
701 6e96b326 2022-03-12 op (cd $testroot/wt && got patch patch) > $testroot/stdout
702 6e96b326 2022-03-12 op ret=$?
703 6e96b326 2022-03-12 op if [ $ret -ne 0 ]; then
704 6e96b326 2022-03-12 op test_done $testroot $ret
705 6e96b326 2022-03-12 op return 1
706 6e96b326 2022-03-12 op fi
707 6e96b326 2022-03-12 op
708 6e96b326 2022-03-12 op cmp -s $testroot/stdout.expected $testroot/stdout
709 6e96b326 2022-03-12 op ret=$?
710 6e96b326 2022-03-12 op if [ $ret -ne 0 ]; then
711 6e96b326 2022-03-12 op diff -u $testroot/stdout.expected $testroot/stdout
712 6e96b326 2022-03-12 op test_done $testroot $ret
713 6e96b326 2022-03-12 op return 1
714 6e96b326 2022-03-12 op fi
715 6e96b326 2022-03-12 op
716 4379a9aa 2022-05-02 op if [ -f $testroot/wt/alpha -o -f $testroot/wt/beta ]; then
717 4379a9aa 2022-05-02 op echo "alpha or beta were not removed" >&2
718 6e96b326 2022-03-12 op test_done $testroot 1
719 6e96b326 2022-03-12 op return 1
720 6e96b326 2022-03-12 op fi
721 4379a9aa 2022-05-02 op if [ ! -f $testroot/wt/iota -o ! -f $testroot/wt/eta ]; then
722 4379a9aa 2022-05-02 op echo "iota or eta were not created" >&2
723 6e96b326 2022-03-12 op test_done $testroot 1
724 6e96b326 2022-03-12 op return 1
725 6e96b326 2022-03-12 op fi
726 6e96b326 2022-03-12 op
727 4379a9aa 2022-05-02 op echo beta > $testroot/wt/iota.expected
728 4379a9aa 2022-05-02 op cmp -s $testroot/wt/iota.expected $testroot/wt/iota
729 6e96b326 2022-03-12 op ret=$?
730 6e96b326 2022-03-12 op if [ $ret -ne 0 ]; then
731 4379a9aa 2022-05-02 op diff -u $testroot/wt/iota.expected $testroot/wt/iota
732 6e96b326 2022-03-12 op test_done $testroot $ret
733 6e96b326 2022-03-12 op return 1
734 6e96b326 2022-03-12 op fi
735 6e96b326 2022-03-12 op
736 4379a9aa 2022-05-02 op echo eta > $testroot/wt/eta.expected
737 4379a9aa 2022-05-02 op cmp -s $testroot/wt/eta.expected $testroot/wt/eta
738 6e96b326 2022-03-12 op ret=$?
739 6e96b326 2022-03-12 op if [ $ret -ne 0 ]; then
740 4379a9aa 2022-05-02 op diff -u $testroot/wt/eta.expected $testroot/wt/eta
741 6e96b326 2022-03-12 op test_done $testroot $ret
742 6e96b326 2022-03-12 op return 1
743 6e96b326 2022-03-12 op fi
744 6e96b326 2022-03-12 op
745 6e96b326 2022-03-12 op test_done $testroot $ret
746 6e96b326 2022-03-12 op }
747 dbda770b 2022-03-13 op
748 dbda770b 2022-03-13 op test_patch_illegal_status() {
749 dbda770b 2022-03-13 op local testroot=`test_init patch_illegal_status`
750 dbda770b 2022-03-13 op
751 dbda770b 2022-03-13 op got checkout $testroot/repo $testroot/wt > /dev/null
752 dbda770b 2022-03-13 op ret=$?
753 dbda770b 2022-03-13 op if [ $ret -ne 0 ]; then
754 dbda770b 2022-03-13 op test_done $testroot $ret
755 dbda770b 2022-03-13 op return 1
756 dbda770b 2022-03-13 op fi
757 dbda770b 2022-03-13 op
758 60aa1fa0 2022-03-17 op # try to patch an obstructed file, add a versioned one, edit a
759 60aa1fa0 2022-03-17 op # non existent file and an unversioned one, and remove a
760 60aa1fa0 2022-03-17 op # non existent file.
761 dbda770b 2022-03-13 op cat <<EOF > $testroot/wt/patch
762 60aa1fa0 2022-03-17 op --- alpha
763 60aa1fa0 2022-03-17 op +++ alpha
764 60aa1fa0 2022-03-17 op @@ -1 +1,2 @@
765 60aa1fa0 2022-03-17 op alpha
766 60aa1fa0 2022-03-17 op +was edited
767 60aa1fa0 2022-03-17 op --- /dev/null
768 60aa1fa0 2022-03-17 op +++ beta
769 60aa1fa0 2022-03-17 op @@ -0,0 +1 @@
770 60aa1fa0 2022-03-17 op +beta
771 dbda770b 2022-03-13 op --- iota
772 dbda770b 2022-03-13 op +++ iota
773 dbda770b 2022-03-13 op @@ -1 +1 @@
774 60aa1fa0 2022-03-17 op -iota
775 60aa1fa0 2022-03-17 op +IOTA
776 60aa1fa0 2022-03-17 op --- kappa
777 60aa1fa0 2022-03-17 op +++ kappa
778 60aa1fa0 2022-03-17 op @@ -1 +1 @@
779 60aa1fa0 2022-03-17 op -kappa
780 60aa1fa0 2022-03-17 op +KAPPA
781 60aa1fa0 2022-03-17 op --- lambda
782 60aa1fa0 2022-03-17 op +++ /dev/null
783 60aa1fa0 2022-03-17 op @@ -1 +0,0 @@
784 60aa1fa0 2022-03-17 op -lambda
785 dbda770b 2022-03-13 op EOF
786 6e96b326 2022-03-12 op
787 60aa1fa0 2022-03-17 op echo kappa > $testroot/wt/kappa
788 dbda770b 2022-03-13 op rm $testroot/wt/alpha
789 dbda770b 2022-03-13 op mkdir $testroot/wt/alpha
790 dbda770b 2022-03-13 op
791 60aa1fa0 2022-03-17 op (cd $testroot/wt && got patch patch) > $testroot/stdout \
792 dbda770b 2022-03-13 op 2> $testroot/stderr
793 dbda770b 2022-03-13 op ret=$?
794 dbda770b 2022-03-13 op if [ $ret -eq 0 ]; then
795 dbda770b 2022-03-13 op echo "edited a missing file" >&2
796 a19f439c 2022-06-03 op test_done $testroot 1
797 dbda770b 2022-03-13 op return 1
798 dbda770b 2022-03-13 op fi
799 dbda770b 2022-03-13 op
800 60aa1fa0 2022-03-17 op cat <<EOF > $testroot/stdout.expected
801 60aa1fa0 2022-03-17 op # alpha
802 60aa1fa0 2022-03-17 op # beta
803 60aa1fa0 2022-03-17 op # iota
804 60aa1fa0 2022-03-17 op # kappa
805 60aa1fa0 2022-03-17 op # lambda
806 60aa1fa0 2022-03-17 op EOF
807 dbda770b 2022-03-13 op
808 60aa1fa0 2022-03-17 op cat <<EOF > $testroot/stderr.expected
809 60aa1fa0 2022-03-17 op got: alpha: file has unexpected status
810 60aa1fa0 2022-03-17 op got: beta: file has unexpected status
811 60aa1fa0 2022-03-17 op got: iota: No such file or directory
812 60aa1fa0 2022-03-17 op got: kappa: file has unexpected status
813 60aa1fa0 2022-03-17 op got: lambda: No such file or directory
814 60aa1fa0 2022-03-17 op got: patch failed to apply
815 dbda770b 2022-03-13 op EOF
816 dbda770b 2022-03-13 op
817 60aa1fa0 2022-03-17 op cmp -s $testroot/stdout.expected $testroot/stdout
818 dbda770b 2022-03-13 op ret=$?
819 60aa1fa0 2022-03-17 op if [ $ret -ne 0 ]; then
820 60aa1fa0 2022-03-17 op diff -u $testroot/stdout.expected $testroot/stdout
821 dbda770b 2022-03-13 op test_done $testroot $ret
822 dbda770b 2022-03-13 op return 1
823 dbda770b 2022-03-13 op fi
824 dbda770b 2022-03-13 op
825 dbda770b 2022-03-13 op cmp -s $testroot/stderr.expected $testroot/stderr
826 dbda770b 2022-03-13 op ret=$?
827 60aa1fa0 2022-03-17 op if [ $ret -ne 0 ]; then
828 dbda770b 2022-03-13 op diff -u $testroot/stderr.expected $testroot/stderr
829 78f5ac24 2022-03-19 op test_done $testroot $ret
830 78f5ac24 2022-03-19 op return 1
831 dbda770b 2022-03-13 op fi
832 78f5ac24 2022-03-19 op
833 78f5ac24 2022-03-19 op (cd $testroot/wt && got status) > $testroot/stdout
834 78f5ac24 2022-03-19 op cat <<EOF > $testroot/stdout.expected
835 78f5ac24 2022-03-19 op ~ alpha
836 78f5ac24 2022-03-19 op ? kappa
837 78f5ac24 2022-03-19 op ? patch
838 78f5ac24 2022-03-19 op EOF
839 78f5ac24 2022-03-19 op
840 78f5ac24 2022-03-19 op cmp -s $testroot/stdout.expected $testroot/stdout
841 78f5ac24 2022-03-19 op ret=$?
842 78f5ac24 2022-03-19 op if [ $ret -ne 0 ]; then
843 78f5ac24 2022-03-19 op diff -u $testroot/stdout.expected $testroot/stdout
844 78f5ac24 2022-03-19 op fi
845 899fcfdf 2022-03-13 op test_done $testroot $ret
846 899fcfdf 2022-03-13 op }
847 899fcfdf 2022-03-13 op
848 899fcfdf 2022-03-13 op test_patch_nop() {
849 899fcfdf 2022-03-13 op local testroot=`test_init patch_nop`
850 899fcfdf 2022-03-13 op
851 899fcfdf 2022-03-13 op got checkout $testroot/repo $testroot/wt > /dev/null
852 899fcfdf 2022-03-13 op ret=$?
853 899fcfdf 2022-03-13 op if [ $ret -ne 0 ]; then
854 899fcfdf 2022-03-13 op test_done $testroot $ret
855 899fcfdf 2022-03-13 op return 1
856 899fcfdf 2022-03-13 op fi
857 899fcfdf 2022-03-13 op
858 899fcfdf 2022-03-13 op cat <<EOF > $testroot/wt/patch
859 899fcfdf 2022-03-13 op --- alpha
860 899fcfdf 2022-03-13 op +++ alpha
861 899fcfdf 2022-03-13 op @@ -1 +1 @@
862 899fcfdf 2022-03-13 op -alpha
863 899fcfdf 2022-03-13 op +cafe alpha
864 899fcfdf 2022-03-13 op --- beta
865 899fcfdf 2022-03-13 op +++ /dev/null
866 899fcfdf 2022-03-13 op @@ -1 +0,0 @@
867 899fcfdf 2022-03-13 op -beta
868 7a30b5cb 2022-03-20 op diff --git a/gamma/delta b/gamma/delta.new
869 899fcfdf 2022-03-13 op --- gamma/delta
870 899fcfdf 2022-03-13 op +++ gamma/delta.new
871 899fcfdf 2022-03-13 op @@ -1 +1 @@
872 899fcfdf 2022-03-13 op -delta
873 899fcfdf 2022-03-13 op +delta updated and renamed!
874 899fcfdf 2022-03-13 op EOF
875 899fcfdf 2022-03-13 op
876 899fcfdf 2022-03-13 op (cd $testroot/wt && got patch -n patch)
877 899fcfdf 2022-03-13 op ret=$?
878 899fcfdf 2022-03-13 op if [ $ret -ne 0 ]; then
879 899fcfdf 2022-03-13 op test_done $testroot $ret
880 899fcfdf 2022-03-13 op return 1
881 dbda770b 2022-03-13 op fi
882 899fcfdf 2022-03-13 op
883 899fcfdf 2022-03-13 op # remove the patch to avoid the ? entry
884 899fcfdf 2022-03-13 op rm $testroot/wt/patch
885 899fcfdf 2022-03-13 op
886 899fcfdf 2022-03-13 op (cd $testroot/wt && got status) > $testroot/stdout
887 899fcfdf 2022-03-13 op ret=$?
888 899fcfdf 2022-03-13 op if [ $ret -ne 0 ]; then
889 899fcfdf 2022-03-13 op test_done $testroot $ret
890 899fcfdf 2022-03-13 op return 1
891 899fcfdf 2022-03-13 op fi
892 899fcfdf 2022-03-13 op
893 899fcfdf 2022-03-13 op echo -n > $testroot/stdout.expected
894 899fcfdf 2022-03-13 op cmp -s $testroot/stdout.expected $testroot/stdout
895 899fcfdf 2022-03-13 op ret=$?
896 899fcfdf 2022-03-13 op if [ $ret -ne 0 ]; then
897 899fcfdf 2022-03-13 op diff -u $testroot/stdout.expected $testroot/stdout
898 899fcfdf 2022-03-13 op fi
899 dbda770b 2022-03-13 op test_done $testroot $ret
900 2be5e1a2 2022-03-16 op }
901 2be5e1a2 2022-03-16 op
902 2be5e1a2 2022-03-16 op test_patch_preserve_perm() {
903 2be5e1a2 2022-03-16 op local testroot=`test_init patch_preserve_perm`
904 2be5e1a2 2022-03-16 op
905 2be5e1a2 2022-03-16 op got checkout $testroot/repo $testroot/wt > /dev/null
906 2be5e1a2 2022-03-16 op ret=$?
907 2be5e1a2 2022-03-16 op if [ $ret -ne 0 ]; then
908 2be5e1a2 2022-03-16 op test_done $testroot $ret
909 2be5e1a2 2022-03-16 op return 1
910 2be5e1a2 2022-03-16 op fi
911 2be5e1a2 2022-03-16 op
912 2be5e1a2 2022-03-16 op chmod +x $testroot/wt/alpha
913 2be5e1a2 2022-03-16 op (cd $testroot/wt && got commit -m 'alpha executable') > /dev/null
914 2be5e1a2 2022-03-16 op ret=$?
915 2be5e1a2 2022-03-16 op if [ $ret -ne 0 ]; then
916 2be5e1a2 2022-03-16 op test_done $testroot $ret
917 2be5e1a2 2022-03-16 op return 1
918 2be5e1a2 2022-03-16 op fi
919 2be5e1a2 2022-03-16 op
920 2be5e1a2 2022-03-16 op cat <<EOF > $testroot/wt/patch
921 2be5e1a2 2022-03-16 op --- alpha
922 2be5e1a2 2022-03-16 op +++ alpha
923 2be5e1a2 2022-03-16 op @@ -1 +1,2 @@
924 2be5e1a2 2022-03-16 op alpha
925 2be5e1a2 2022-03-16 op +was edited
926 2be5e1a2 2022-03-16 op EOF
927 2be5e1a2 2022-03-16 op
928 2be5e1a2 2022-03-16 op (cd $testroot/wt && got patch patch) > /dev/null
929 2be5e1a2 2022-03-16 op ret=$?
930 2be5e1a2 2022-03-16 op if [ $ret -ne 0 ]; then
931 2be5e1a2 2022-03-16 op test_done $testroot $ret
932 2be5e1a2 2022-03-16 op return 1
933 2be5e1a2 2022-03-16 op fi
934 2be5e1a2 2022-03-16 op
935 2be5e1a2 2022-03-16 op if [ ! -x $testroot/wt/alpha ]; then
936 2be5e1a2 2022-03-16 op echo "alpha is no more executable!" >&2
937 2be5e1a2 2022-03-16 op test_done $testroot 1
938 95d68340 2022-03-16 op return 1
939 95d68340 2022-03-16 op fi
940 95d68340 2022-03-16 op test_done $testroot 0
941 95d68340 2022-03-16 op }
942 95d68340 2022-03-16 op
943 95d68340 2022-03-16 op test_patch_create_dirs() {
944 95d68340 2022-03-16 op local testroot=`test_init patch_create_dirs`
945 95d68340 2022-03-16 op
946 95d68340 2022-03-16 op got checkout $testroot/repo $testroot/wt > /dev/null
947 95d68340 2022-03-16 op ret=$?
948 95d68340 2022-03-16 op if [ $ret -ne 0 ]; then
949 95d68340 2022-03-16 op test_done $testroot $ret
950 95d68340 2022-03-16 op return 1
951 95d68340 2022-03-16 op fi
952 95d68340 2022-03-16 op
953 95d68340 2022-03-16 op cat <<EOF > $testroot/wt/patch
954 95d68340 2022-03-16 op --- /dev/null
955 95d68340 2022-03-16 op +++ iota/kappa/lambda
956 95d68340 2022-03-16 op @@ -0,0 +1 @@
957 95d68340 2022-03-16 op +lambda
958 95d68340 2022-03-16 op EOF
959 95d68340 2022-03-16 op
960 95d68340 2022-03-16 op (cd $testroot/wt && got patch patch) > $testroot/stdout
961 95d68340 2022-03-16 op ret=$?
962 95d68340 2022-03-16 op if [ $ret -ne 0 ]; then
963 95d68340 2022-03-16 op test_done $testroot $ret
964 2be5e1a2 2022-03-16 op return 1
965 2be5e1a2 2022-03-16 op fi
966 95d68340 2022-03-16 op
967 95d68340 2022-03-16 op echo 'A iota/kappa/lambda' >> $testroot/stdout.expected
968 95d68340 2022-03-16 op cmp -s $testroot/stdout.expected $testroot/stdout
969 95d68340 2022-03-16 op ret=$?
970 95d68340 2022-03-16 op if [ $ret -ne 0 ]; then
971 95d68340 2022-03-16 op diff -u $testroot/stdout.expected $testroot/stdout
972 95d68340 2022-03-16 op test_done $testroot $ret
973 95d68340 2022-03-16 op return 1
974 95d68340 2022-03-16 op fi
975 95d68340 2022-03-16 op
976 95d68340 2022-03-16 op if [ ! -f $testroot/wt/iota/kappa/lambda ]; then
977 95d68340 2022-03-16 op echo "file not created!" >&2
978 95d68340 2022-03-16 op test_done $testroot $ret
979 95d68340 2022-03-16 op return 1
980 95d68340 2022-03-16 op fi
981 2be5e1a2 2022-03-16 op test_done $testroot 0
982 dbda770b 2022-03-13 op }
983 dbda770b 2022-03-13 op
984 60aa1fa0 2022-03-17 op test_patch_with_offset() {
985 60aa1fa0 2022-03-17 op local testroot=`test_init patch_with_offset`
986 60aa1fa0 2022-03-17 op
987 60aa1fa0 2022-03-17 op got checkout $testroot/repo $testroot/wt > /dev/null
988 60aa1fa0 2022-03-17 op ret=$?
989 60aa1fa0 2022-03-17 op if [ $ret -ne 0 ]; then
990 60aa1fa0 2022-03-17 op test_done $testroot $ret
991 60aa1fa0 2022-03-17 op return 1
992 60aa1fa0 2022-03-17 op fi
993 60aa1fa0 2022-03-17 op
994 60aa1fa0 2022-03-17 op cat <<EOF > $testroot/wt/patch
995 60aa1fa0 2022-03-17 op --- numbers
996 60aa1fa0 2022-03-17 op +++ numbers
997 60aa1fa0 2022-03-17 op @@ -47,7 +47,7 @@
998 60aa1fa0 2022-03-17 op 47
999 60aa1fa0 2022-03-17 op 48
1000 60aa1fa0 2022-03-17 op 49
1001 60aa1fa0 2022-03-17 op -50
1002 60aa1fa0 2022-03-17 op +midway tru it!
1003 60aa1fa0 2022-03-17 op 51
1004 60aa1fa0 2022-03-17 op 52
1005 60aa1fa0 2022-03-17 op 53
1006 60aa1fa0 2022-03-17 op @@ -87,7 +87,7 @@
1007 60aa1fa0 2022-03-17 op 87
1008 60aa1fa0 2022-03-17 op 88
1009 60aa1fa0 2022-03-17 op 89
1010 60aa1fa0 2022-03-17 op -90
1011 60aa1fa0 2022-03-17 op +almost there!
1012 60aa1fa0 2022-03-17 op 91
1013 60aa1fa0 2022-03-17 op 92
1014 60aa1fa0 2022-03-17 op 93
1015 60aa1fa0 2022-03-17 op EOF
1016 60aa1fa0 2022-03-17 op
1017 60aa1fa0 2022-03-17 op jot 100 > $testroot/wt/numbers
1018 60aa1fa0 2022-03-17 op ed $testroot/wt/numbers <<EOF > /dev/null 2> /dev/null
1019 60aa1fa0 2022-03-17 op 1,10d
1020 60aa1fa0 2022-03-17 op 50r !jot 20
1021 60aa1fa0 2022-03-17 op w
1022 60aa1fa0 2022-03-17 op q
1023 60aa1fa0 2022-03-17 op EOF
1024 60aa1fa0 2022-03-17 op
1025 60aa1fa0 2022-03-17 op (cd $testroot/wt && got add numbers && got commit -m '+numbers') \
1026 60aa1fa0 2022-03-17 op > /dev/null
1027 60aa1fa0 2022-03-17 op ret=$?
1028 60aa1fa0 2022-03-17 op if [ $ret -ne 0 ]; then
1029 60aa1fa0 2022-03-17 op test_done $testroot $ret
1030 60aa1fa0 2022-03-17 op return 1
1031 60aa1fa0 2022-03-17 op fi
1032 60aa1fa0 2022-03-17 op
1033 60aa1fa0 2022-03-17 op (cd $testroot/wt && got patch patch) > $testroot/stdout
1034 60aa1fa0 2022-03-17 op ret=$?
1035 60aa1fa0 2022-03-17 op if [ $ret -ne 0 ]; then
1036 60aa1fa0 2022-03-17 op test_done $testroot/wt $ret
1037 60aa1fa0 2022-03-17 op return 1
1038 60aa1fa0 2022-03-17 op fi
1039 60aa1fa0 2022-03-17 op
1040 60aa1fa0 2022-03-17 op cat <<EOF > $testroot/stdout.expected
1041 60aa1fa0 2022-03-17 op M numbers
1042 60aa1fa0 2022-03-17 op @@ -47,7 +47,7 @@ applied with offset -10
1043 60aa1fa0 2022-03-17 op @@ -87,7 +87,7 @@ applied with offset 10
1044 7a30b5cb 2022-03-20 op EOF
1045 7a30b5cb 2022-03-20 op
1046 7a30b5cb 2022-03-20 op cmp -s $testroot/stdout.expected $testroot/stdout
1047 7a30b5cb 2022-03-20 op ret=$?
1048 7a30b5cb 2022-03-20 op if [ $ret -ne 0 ]; then
1049 7a30b5cb 2022-03-20 op diff -u $testroot/stdout.expected $testroot/stdout
1050 7a30b5cb 2022-03-20 op fi
1051 7a30b5cb 2022-03-20 op test_done $testroot $ret
1052 7a30b5cb 2022-03-20 op }
1053 7a30b5cb 2022-03-20 op
1054 7a30b5cb 2022-03-20 op test_patch_prefer_new_path() {
1055 7a30b5cb 2022-03-20 op local testroot=`test_init patch_orig`
1056 7a30b5cb 2022-03-20 op
1057 7a30b5cb 2022-03-20 op got checkout $testroot/repo $testroot/wt > /dev/null
1058 7a30b5cb 2022-03-20 op ret=$?
1059 7a30b5cb 2022-03-20 op if [ $ret -ne 0 ]; then
1060 7a30b5cb 2022-03-20 op test_done $testroot $ret
1061 7a30b5cb 2022-03-20 op return 1
1062 7a30b5cb 2022-03-20 op fi
1063 7a30b5cb 2022-03-20 op
1064 7a30b5cb 2022-03-20 op cat <<EOF > $testroot/wt/patch
1065 7a30b5cb 2022-03-20 op --- alpha.orig
1066 7a30b5cb 2022-03-20 op +++ alpha
1067 7a30b5cb 2022-03-20 op @@ -1 +1,2 @@
1068 7a30b5cb 2022-03-20 op alpha
1069 7a30b5cb 2022-03-20 op +was edited
1070 60aa1fa0 2022-03-17 op EOF
1071 60aa1fa0 2022-03-17 op
1072 7a30b5cb 2022-03-20 op (cd $testroot/wt && got patch patch) > $testroot/stdout
1073 7a30b5cb 2022-03-20 op ret=$?
1074 7a30b5cb 2022-03-20 op if [ $ret -ne 0 ]; then
1075 7a30b5cb 2022-03-20 op test_done $testroot $ret
1076 7a30b5cb 2022-03-20 op return 1
1077 7a30b5cb 2022-03-20 op fi
1078 7a30b5cb 2022-03-20 op
1079 3313bcd8 2022-04-19 op echo 'M alpha' > $testroot/stdout.expected
1080 60aa1fa0 2022-03-17 op cmp -s $testroot/stdout.expected $testroot/stdout
1081 60aa1fa0 2022-03-17 op ret=$?
1082 60aa1fa0 2022-03-17 op if [ $ret -ne 0 ]; then
1083 60aa1fa0 2022-03-17 op diff -u $testroot/stdout.expected $testroot/stdout
1084 60aa1fa0 2022-03-17 op fi
1085 60aa1fa0 2022-03-17 op test_done $testroot $ret
1086 60aa1fa0 2022-03-17 op }
1087 60aa1fa0 2022-03-17 op
1088 b3c57ab2 2022-03-22 op test_patch_no_newline() {
1089 b3c57ab2 2022-03-22 op local testroot=`test_init patch_no_newline`
1090 b3c57ab2 2022-03-22 op
1091 b3c57ab2 2022-03-22 op got checkout $testroot/repo $testroot/wt > /dev/null
1092 b3c57ab2 2022-03-22 op ret=$?
1093 b3c57ab2 2022-03-22 op if [ $ret -ne 0 ]; then
1094 b3c57ab2 2022-03-22 op test_done $testroot $ret
1095 b3c57ab2 2022-03-22 op return 1
1096 b3c57ab2 2022-03-22 op fi
1097 b3c57ab2 2022-03-22 op
1098 b3c57ab2 2022-03-22 op cat <<EOF > $testroot/wt/patch
1099 b3c57ab2 2022-03-22 op --- /dev/null
1100 b3c57ab2 2022-03-22 op +++ eta
1101 b3c57ab2 2022-03-22 op @@ -0,0 +1 @@
1102 b3c57ab2 2022-03-22 op +eta
1103 b3c57ab2 2022-03-22 op \ No newline at end of file
1104 b3c57ab2 2022-03-22 op EOF
1105 b3c57ab2 2022-03-22 op
1106 b3c57ab2 2022-03-22 op (cd $testroot/wt && got patch patch) > $testroot/stdout
1107 b3c57ab2 2022-03-22 op ret=$?
1108 b3c57ab2 2022-03-22 op if [ $ret -ne 0 ]; then
1109 b3c57ab2 2022-03-22 op test_done $testroot $ret
1110 b3c57ab2 2022-03-22 op return 1
1111 b3c57ab2 2022-03-22 op fi
1112 b3c57ab2 2022-03-22 op
1113 b3c57ab2 2022-03-22 op echo "A eta" > $testroot/stdout.expected
1114 b3c57ab2 2022-03-22 op cmp -s $testroot/stdout.expected $testroot/stdout
1115 b3c57ab2 2022-03-22 op ret=$?
1116 b3c57ab2 2022-03-22 op if [ $ret -ne 0 ]; then
1117 b3c57ab2 2022-03-22 op diff -u $testroot/stdout.expected $testroot/stdout
1118 b3c57ab2 2022-03-22 op test_done $testroot $ret
1119 b3c57ab2 2022-03-22 op return 1
1120 b3c57ab2 2022-03-22 op fi
1121 b3c57ab2 2022-03-22 op
1122 b3c57ab2 2022-03-22 op echo -n eta > $testroot/wt/eta.expected
1123 b3c57ab2 2022-03-22 op cmp -s $testroot/wt/eta.expected $testroot/wt/eta
1124 b3c57ab2 2022-03-22 op ret=$?
1125 b3c57ab2 2022-03-22 op if [ $ret -ne 0 ]; then
1126 b3c57ab2 2022-03-22 op diff -u $testroot/wt/eta.expected $testroot/wt/eta
1127 b3c57ab2 2022-03-22 op test_done $testroot $ret
1128 b3c57ab2 2022-03-22 op return 1
1129 b3c57ab2 2022-03-22 op fi
1130 b3c57ab2 2022-03-22 op
1131 b3c57ab2 2022-03-22 op (cd $testroot/wt && got commit -m 'add eta') > /dev/null
1132 b3c57ab2 2022-03-22 op ret=$?
1133 b3c57ab2 2022-03-22 op if [ $ret -ne 0 ]; then
1134 b3c57ab2 2022-03-22 op test_done $testroot $ret
1135 b3c57ab2 2022-03-22 op return 1
1136 b3c57ab2 2022-03-22 op fi
1137 b3c57ab2 2022-03-22 op
1138 b3c57ab2 2022-03-22 op cat <<EOF > $testroot/wt/patch
1139 b3c57ab2 2022-03-22 op --- eta
1140 b3c57ab2 2022-03-22 op +++ eta
1141 b3c57ab2 2022-03-22 op @@ -1 +1 @@
1142 b3c57ab2 2022-03-22 op -eta
1143 b3c57ab2 2022-03-22 op \ No newline at end of file
1144 b3c57ab2 2022-03-22 op +ETA
1145 b3c57ab2 2022-03-22 op \ No newline at end of file
1146 b3c57ab2 2022-03-22 op EOF
1147 b3c57ab2 2022-03-22 op
1148 b3c57ab2 2022-03-22 op (cd $testroot/wt && got patch patch) > $testroot/stdout
1149 b3c57ab2 2022-03-22 op ret=$?
1150 b3c57ab2 2022-03-22 op if [ $ret -ne 0 ]; then
1151 b3c57ab2 2022-03-22 op test_done $testroot $ret
1152 b3c57ab2 2022-03-22 op return 1
1153 b3c57ab2 2022-03-22 op fi
1154 b3c57ab2 2022-03-22 op
1155 b3c57ab2 2022-03-22 op echo "M eta" > $testroot/stdout.expected
1156 b3c57ab2 2022-03-22 op cmp -s $testroot/stdout.expected $testroot/stdout
1157 b3c57ab2 2022-03-22 op ret=$?
1158 b3c57ab2 2022-03-22 op if [ $ret -ne 0 ]; then
1159 b3c57ab2 2022-03-22 op diff -u $testroot/stdout.expected $testroot/stdout
1160 b3c57ab2 2022-03-22 op test_done $testroot $ret
1161 b3c57ab2 2022-03-22 op return 1
1162 b3c57ab2 2022-03-22 op fi
1163 b3c57ab2 2022-03-22 op
1164 b3c57ab2 2022-03-22 op echo -n ETA > $testroot/wt/eta.expected
1165 b3c57ab2 2022-03-22 op cmp -s $testroot/wt/eta.expected $testroot/wt/eta
1166 b3c57ab2 2022-03-22 op ret=$?
1167 b3c57ab2 2022-03-22 op if [ $ret -ne 0 ]; then
1168 b3c57ab2 2022-03-22 op diff -u $testroot/wt/eta.expected $testroot/wt/eta
1169 b3c57ab2 2022-03-22 op test_done $testroot $ret
1170 b3c57ab2 2022-03-22 op return 1
1171 b3c57ab2 2022-03-22 op fi
1172 b3c57ab2 2022-03-22 op
1173 b3c57ab2 2022-03-22 op (cd $testroot/wt && got commit -m 'edit eta') > /dev/null
1174 b3c57ab2 2022-03-22 op ret=$?
1175 b3c57ab2 2022-03-22 op if [ $ret -ne 0 ]; then
1176 b3c57ab2 2022-03-22 op test_done $testroot $ret
1177 b3c57ab2 2022-03-22 op return 1
1178 b3c57ab2 2022-03-22 op fi
1179 b3c57ab2 2022-03-22 op
1180 b3c57ab2 2022-03-22 op cat <<EOF > $testroot/wt/patch
1181 b3c57ab2 2022-03-22 op --- eta
1182 b3c57ab2 2022-03-22 op +++ eta
1183 b3c57ab2 2022-03-22 op @@ -1 +1 @@
1184 b3c57ab2 2022-03-22 op -ETA
1185 b3c57ab2 2022-03-22 op \ No newline at end of file
1186 b3c57ab2 2022-03-22 op +eta
1187 b3c57ab2 2022-03-22 op EOF
1188 b3c57ab2 2022-03-22 op
1189 b3c57ab2 2022-03-22 op (cd $testroot/wt && got patch patch) > $testroot/stdout
1190 b3c57ab2 2022-03-22 op ret=$?
1191 b3c57ab2 2022-03-22 op if [ $ret -ne 0 ]; then
1192 b3c57ab2 2022-03-22 op test_done $testroot $ret
1193 b3c57ab2 2022-03-22 op return 1
1194 b3c57ab2 2022-03-22 op fi
1195 b3c57ab2 2022-03-22 op
1196 b3c57ab2 2022-03-22 op echo "M eta" > $testroot/stdout.expected
1197 b3c57ab2 2022-03-22 op cmp -s $testroot/stdout.expected $testroot/stdout
1198 b3c57ab2 2022-03-22 op ret=$?
1199 b3c57ab2 2022-03-22 op if [ $ret -ne 0 ]; then
1200 b3c57ab2 2022-03-22 op diff -u $testroot/stdout.expected $testroot/stdout
1201 b3c57ab2 2022-03-22 op test_done $testroot $ret
1202 b3c57ab2 2022-03-22 op return 1
1203 b3c57ab2 2022-03-22 op fi
1204 b3c57ab2 2022-03-22 op
1205 b3c57ab2 2022-03-22 op echo eta > $testroot/wt/eta.expected
1206 b3c57ab2 2022-03-22 op cmp -s $testroot/wt/eta.expected $testroot/wt/eta
1207 b3c57ab2 2022-03-22 op ret=$?
1208 b3c57ab2 2022-03-22 op if [ $ret -ne 0 ]; then
1209 b3c57ab2 2022-03-22 op diff -u $testroot/wt/eta.expected $testroot/wt/eta
1210 b3c57ab2 2022-03-22 op fi
1211 b3c57ab2 2022-03-22 op test_done $testroot $ret
1212 b3c57ab2 2022-03-22 op }
1213 b3c57ab2 2022-03-22 op
1214 9d6cabd5 2022-04-07 op test_patch_strip() {
1215 9d6cabd5 2022-04-07 op local testroot=`test_init patch_strip`
1216 9d6cabd5 2022-04-07 op
1217 9d6cabd5 2022-04-07 op got checkout $testroot/repo $testroot/wt > /dev/null
1218 9d6cabd5 2022-04-07 op ret=$?
1219 9d6cabd5 2022-04-07 op if [ $ret -ne 0 ]; then
1220 9d6cabd5 2022-04-07 op test_done $testroot $ret
1221 9d6cabd5 2022-04-07 op return 1
1222 9d6cabd5 2022-04-07 op fi
1223 9d6cabd5 2022-04-07 op
1224 9d6cabd5 2022-04-07 op cat <<EOF > $testroot/wt/patch
1225 9d6cabd5 2022-04-07 op --- foo/bar/alpha.orig
1226 9d6cabd5 2022-04-07 op +++ foo/bar/alpha
1227 9d6cabd5 2022-04-07 op @@ -1 +1 @@
1228 9d6cabd5 2022-04-07 op -alpha
1229 9d6cabd5 2022-04-07 op +ALPHA
1230 9d6cabd5 2022-04-07 op EOF
1231 9d6cabd5 2022-04-07 op
1232 9d6cabd5 2022-04-07 op (cd $testroot/wt && got patch -p2 patch) > $testroot/stdout
1233 9d6cabd5 2022-04-07 op ret=$?
1234 9d6cabd5 2022-04-07 op if [ $ret -ne 0 ]; then
1235 9d6cabd5 2022-04-07 op test_done $testroot $ret
1236 9d6cabd5 2022-04-07 op return 1
1237 9d6cabd5 2022-04-07 op fi
1238 9d6cabd5 2022-04-07 op
1239 9d6cabd5 2022-04-07 op echo "M alpha" >> $testroot/stdout.expected
1240 9d6cabd5 2022-04-07 op cmp -s $testroot/stdout.expected $testroot/stdout
1241 9d6cabd5 2022-04-07 op ret=$?
1242 9d6cabd5 2022-04-07 op if [ $ret -ne 0 ]; then
1243 9d6cabd5 2022-04-07 op diff -u $testroot/stdout.expected $testroot/stdout
1244 9d6cabd5 2022-04-07 op test_done $testroot $ret
1245 9d6cabd5 2022-04-07 op return 1
1246 9d6cabd5 2022-04-07 op fi
1247 9d6cabd5 2022-04-07 op
1248 9d6cabd5 2022-04-07 op (cd $testroot/wt && got revert alpha) > /dev/null 2>&1
1249 9d6cabd5 2022-04-07 op ret=$?
1250 9d6cabd5 2022-04-07 op if [ $ret -ne 0 ]; then
1251 9d6cabd5 2022-04-07 op test_done $testroot $ret
1252 9d6cabd5 2022-04-07 op return 1
1253 9d6cabd5 2022-04-07 op fi
1254 9d6cabd5 2022-04-07 op
1255 9d6cabd5 2022-04-07 op (cd $testroot/wt && got patch -p3 patch) \
1256 9d6cabd5 2022-04-07 op 2> $testroot/stderr
1257 9d6cabd5 2022-04-07 op ret=$?
1258 9d6cabd5 2022-04-07 op if [ $ret -eq 0 ]; then
1259 9d6cabd5 2022-04-07 op echo "stripped more components than available!"
1260 9d6cabd5 2022-04-07 op test_done $testroot 1
1261 9d6cabd5 2022-04-07 op return 1
1262 9d6cabd5 2022-04-07 op fi
1263 9d6cabd5 2022-04-07 op
1264 9d6cabd5 2022-04-07 op cat <<EOF > $testroot/stderr.expected
1265 9d6cabd5 2022-04-07 op got: can't strip 1 path-components from foo/bar/alpha: bad path
1266 9d6cabd5 2022-04-07 op EOF
1267 9d6cabd5 2022-04-07 op
1268 9d6cabd5 2022-04-07 op cmp -s $testroot/stderr.expected $testroot/stderr
1269 9d6cabd5 2022-04-07 op ret=$?
1270 9d6cabd5 2022-04-07 op if [ $ret -ne 0 ]; then
1271 9d6cabd5 2022-04-07 op diff -u $testroot/stderr.expected $testroot/stderr
1272 9d6cabd5 2022-04-07 op fi
1273 9d6cabd5 2022-04-07 op test_done $testroot 0
1274 9d6cabd5 2022-04-07 op }
1275 ed3bff83 2022-04-23 op
1276 ed3bff83 2022-04-23 op test_patch_relative_paths() {
1277 f1d6cebb 2022-04-23 op local testroot=`test_init patch_relative_paths`
1278 ed3bff83 2022-04-23 op
1279 ed3bff83 2022-04-23 op got checkout $testroot/repo $testroot/wt > /dev/null
1280 ed3bff83 2022-04-23 op ret=$?
1281 ed3bff83 2022-04-23 op if [ $ret -ne 0 ]; then
1282 ed3bff83 2022-04-23 op test_done $testroot $ret
1283 ed3bff83 2022-04-23 op return 1
1284 ed3bff83 2022-04-23 op fi
1285 9d6cabd5 2022-04-07 op
1286 ed3bff83 2022-04-23 op cat <<EOF > $testroot/wt/gamma/patch
1287 ed3bff83 2022-04-23 op --- delta
1288 ed3bff83 2022-04-23 op +++ delta
1289 ed3bff83 2022-04-23 op @@ -1 +1 @@
1290 ed3bff83 2022-04-23 op -delta
1291 ed3bff83 2022-04-23 op +DELTA
1292 ed3bff83 2022-04-23 op --- /dev/null
1293 ed3bff83 2022-04-23 op +++ eta
1294 ed3bff83 2022-04-23 op @@ -0,0 +1 @@
1295 ed3bff83 2022-04-23 op +eta
1296 ed3bff83 2022-04-23 op EOF
1297 ed3bff83 2022-04-23 op
1298 ed3bff83 2022-04-23 op (cd $testroot/wt/gamma && got patch patch) > $testroot/stdout
1299 ed3bff83 2022-04-23 op ret=$?
1300 ed3bff83 2022-04-23 op if [ $ret -ne 0 ]; then
1301 ed3bff83 2022-04-23 op test_done $testroot $ret
1302 ed3bff83 2022-04-23 op return 1
1303 ed3bff83 2022-04-23 op fi
1304 ed3bff83 2022-04-23 op
1305 ed3bff83 2022-04-23 op echo 'M gamma/delta' > $testroot/stdout.expected
1306 ed3bff83 2022-04-23 op echo 'A gamma/eta' >> $testroot/stdout.expected
1307 15e1bda6 2022-04-23 op
1308 15e1bda6 2022-04-23 op cmp -s $testroot/stdout.expected $testroot/stdout
1309 15e1bda6 2022-04-23 op ret=$?
1310 15e1bda6 2022-04-23 op if [ $ret -ne 0 ]; then
1311 15e1bda6 2022-04-23 op diff -u $testroot/stdout.expected $testroot/stdout
1312 15e1bda6 2022-04-23 op fi
1313 15e1bda6 2022-04-23 op test_done $testroot $ret
1314 15e1bda6 2022-04-23 op }
1315 15e1bda6 2022-04-23 op
1316 15e1bda6 2022-04-23 op test_patch_with_path_prefix() {
1317 15e1bda6 2022-04-23 op local testroot=`test_init patch_with_path_prefix`
1318 15e1bda6 2022-04-23 op
1319 15e1bda6 2022-04-23 op got checkout -p gamma $testroot/repo $testroot/wt > /dev/null
1320 15e1bda6 2022-04-23 op ret=$?
1321 15e1bda6 2022-04-23 op if [ $ret -ne 0 ]; then
1322 15e1bda6 2022-04-23 op test_done $testroot $ret
1323 15e1bda6 2022-04-23 op return 1
1324 15e1bda6 2022-04-23 op fi
1325 15e1bda6 2022-04-23 op
1326 15e1bda6 2022-04-23 op cat <<EOF > $testroot/wt/patch
1327 15e1bda6 2022-04-23 op --- delta
1328 15e1bda6 2022-04-23 op +++ delta
1329 15e1bda6 2022-04-23 op @@ -1 +1 @@
1330 15e1bda6 2022-04-23 op -delta
1331 15e1bda6 2022-04-23 op +DELTA
1332 15e1bda6 2022-04-23 op --- /dev/null
1333 15e1bda6 2022-04-23 op +++ eta
1334 15e1bda6 2022-04-23 op @@ -0,0 +1 @@
1335 15e1bda6 2022-04-23 op +eta
1336 15e1bda6 2022-04-23 op EOF
1337 15e1bda6 2022-04-23 op
1338 15e1bda6 2022-04-23 op (cd $testroot/wt && got patch patch) > $testroot/stdout
1339 15e1bda6 2022-04-23 op ret=$?
1340 15e1bda6 2022-04-23 op if [ $ret -ne 0 ]; then
1341 15e1bda6 2022-04-23 op test_done $testroot $ret
1342 15e1bda6 2022-04-23 op return 1
1343 15e1bda6 2022-04-23 op fi
1344 15e1bda6 2022-04-23 op
1345 15e1bda6 2022-04-23 op echo 'M delta' > $testroot/stdout.expected
1346 15e1bda6 2022-04-23 op echo 'A eta' >> $testroot/stdout.expected
1347 15e1bda6 2022-04-23 op
1348 15e1bda6 2022-04-23 op cmp -s $testroot/stdout.expected $testroot/stdout
1349 15e1bda6 2022-04-23 op ret=$?
1350 15e1bda6 2022-04-23 op if [ $ret -ne 0 ]; then
1351 15e1bda6 2022-04-23 op diff -u $testroot/stdout.expected $testroot/stdout
1352 15e1bda6 2022-04-23 op fi
1353 15e1bda6 2022-04-23 op test_done $testroot $ret
1354 15e1bda6 2022-04-23 op }
1355 ed3bff83 2022-04-23 op
1356 15e1bda6 2022-04-23 op test_patch_relpath_with_path_prefix() {
1357 15e1bda6 2022-04-23 op local testroot=`test_init patch_relpaths_with_path_prefix`
1358 15e1bda6 2022-04-23 op
1359 15e1bda6 2022-04-23 op got checkout -p gamma $testroot/repo $testroot/wt > /dev/null
1360 15e1bda6 2022-04-23 op ret=$?
1361 15e1bda6 2022-04-23 op if [ $ret -ne 0 ]; then
1362 15e1bda6 2022-04-23 op test_done $testroot $ret
1363 15e1bda6 2022-04-23 op return 1
1364 15e1bda6 2022-04-23 op fi
1365 15e1bda6 2022-04-23 op
1366 15e1bda6 2022-04-23 op mkdir -p $testroot/wt/epsilon/zeta/
1367 15e1bda6 2022-04-23 op
1368 15e1bda6 2022-04-23 op cat <<EOF > $testroot/wt/patch
1369 15e1bda6 2022-04-23 op --- /dev/null
1370 15e1bda6 2022-04-23 op +++ zeta/theta
1371 15e1bda6 2022-04-23 op @@ -0,0 +1 @@
1372 15e1bda6 2022-04-23 op +theta
1373 15e1bda6 2022-04-23 op EOF
1374 15e1bda6 2022-04-23 op
1375 15e1bda6 2022-04-23 op (cd $testroot/wt/epsilon/zeta && got patch -p1 $testroot/wt/patch) \
1376 15e1bda6 2022-04-23 op > $testroot/stdout
1377 15e1bda6 2022-04-23 op ret=$?
1378 15e1bda6 2022-04-23 op if [ $ret -ne 0 ]; then
1379 15e1bda6 2022-04-23 op test_done $testroot $ret
1380 15e1bda6 2022-04-23 op return 1
1381 15e1bda6 2022-04-23 op fi
1382 15e1bda6 2022-04-23 op
1383 15e1bda6 2022-04-23 op echo 'A epsilon/zeta/theta' >> $testroot/stdout.expected
1384 15e1bda6 2022-04-23 op
1385 ed3bff83 2022-04-23 op cmp -s $testroot/stdout.expected $testroot/stdout
1386 ed3bff83 2022-04-23 op ret=$?
1387 ed3bff83 2022-04-23 op if [ $ret -ne 0 ]; then
1388 ed3bff83 2022-04-23 op diff -u $testroot/stdout.expected $testroot/stdout
1389 15e1bda6 2022-04-23 op test_done $testroot $ret
1390 15e1bda6 2022-04-23 op return 1
1391 ed3bff83 2022-04-23 op fi
1392 15e1bda6 2022-04-23 op
1393 15e1bda6 2022-04-23 op echo 'theta' > $testroot/theta.expected
1394 15e1bda6 2022-04-23 op cmp -s $testroot/wt/epsilon/zeta/theta $testroot/theta.expected
1395 15e1bda6 2022-04-23 op ret=$?
1396 15e1bda6 2022-04-23 op if [ $ret -ne 0 ]; then
1397 15e1bda6 2022-04-23 op diff -u $testroot/wt/epsilon/zeta/theta $testroot/theta.expected
1398 15e1bda6 2022-04-23 op fi
1399 ed3bff83 2022-04-23 op test_done $testroot $ret
1400 ed3bff83 2022-04-23 op }
1401 bad961bf 2022-04-23 op
1402 bad961bf 2022-04-23 op test_patch_reverse() {
1403 bad961bf 2022-04-23 op local testroot=`test_init patch_reverse`
1404 bad961bf 2022-04-23 op
1405 bad961bf 2022-04-23 op got checkout $testroot/repo $testroot/wt > /dev/null
1406 bad961bf 2022-04-23 op ret=$?
1407 bad961bf 2022-04-23 op if [ $ret -ne 0 ]; then
1408 bad961bf 2022-04-23 op test_done $testroot $ret
1409 bad961bf 2022-04-23 op return 1
1410 bad961bf 2022-04-23 op fi
1411 bad961bf 2022-04-23 op
1412 bad961bf 2022-04-23 op cat <<EOF > $testroot/wt/patch
1413 bad961bf 2022-04-23 op --- alpha
1414 bad961bf 2022-04-23 op +++ alpha
1415 bad961bf 2022-04-23 op @@ -1 +1 @@
1416 bad961bf 2022-04-23 op -ALPHA
1417 bad961bf 2022-04-23 op \ No newline at end of file
1418 bad961bf 2022-04-23 op +alpha
1419 bad961bf 2022-04-23 op EOF
1420 ed3bff83 2022-04-23 op
1421 bad961bf 2022-04-23 op (cd $testroot/wt && got patch -R patch) > $testroot/stdout
1422 bad961bf 2022-04-23 op ret=$?
1423 bad961bf 2022-04-23 op if [ $ret -ne 0 ]; then
1424 bad961bf 2022-04-23 op test_done $testroot $ret
1425 bad961bf 2022-04-23 op return 1
1426 bad961bf 2022-04-23 op fi
1427 bad961bf 2022-04-23 op
1428 bad961bf 2022-04-23 op echo "M alpha" > $testroot/stdout.expected
1429 bad961bf 2022-04-23 op cmp -s $testroot/stdout.expected $testroot/stdout
1430 bad961bf 2022-04-23 op ret=$?
1431 bad961bf 2022-04-23 op if [ $ret -ne 0 ]; then
1432 bad961bf 2022-04-23 op diff -u $testroot/stdout.expected $testroot/stdout
1433 bad961bf 2022-04-23 op test_done $testroot $ret
1434 bad961bf 2022-04-23 op return 1
1435 bad961bf 2022-04-23 op fi
1436 bad961bf 2022-04-23 op
1437 bad961bf 2022-04-23 op echo -n ALPHA > $testroot/wt/alpha.expected
1438 bad961bf 2022-04-23 op cmp -s $testroot/wt/alpha.expected $testroot/wt/alpha
1439 bad961bf 2022-04-23 op ret=$?
1440 bad961bf 2022-04-23 op if [ $ret -ne 0 ]; then
1441 bad961bf 2022-04-23 op diff -u $testroot/wt/alpha.expected $testroot/wt/alpha
1442 bad961bf 2022-04-23 op fi
1443 bad961bf 2022-04-23 op test_done $testroot $ret
1444 bad961bf 2022-04-23 op }
1445 bad961bf 2022-04-23 op
1446 e9ce266e 2022-03-07 op test_parseargs "$@"
1447 e9ce266e 2022-03-07 op run_test test_patch_simple_add_file
1448 e9ce266e 2022-03-07 op run_test test_patch_simple_rm_file
1449 e9ce266e 2022-03-07 op run_test test_patch_simple_edit_file
1450 e9ce266e 2022-03-07 op run_test test_patch_prepend_line
1451 e9ce266e 2022-03-07 op run_test test_patch_replace_line
1452 e9ce266e 2022-03-07 op run_test test_patch_multiple_hunks
1453 e9ce266e 2022-03-07 op run_test test_patch_multiple_files
1454 e9ce266e 2022-03-07 op run_test test_patch_dont_apply
1455 e9ce266e 2022-03-07 op run_test test_patch_malformed
1456 e9ce266e 2022-03-07 op run_test test_patch_no_patch
1457 e9ce266e 2022-03-07 op run_test test_patch_equals_for_context
1458 6e96b326 2022-03-12 op run_test test_patch_rename
1459 dbda770b 2022-03-13 op run_test test_patch_illegal_status
1460 899fcfdf 2022-03-13 op run_test test_patch_nop
1461 2be5e1a2 2022-03-16 op run_test test_patch_preserve_perm
1462 95d68340 2022-03-16 op run_test test_patch_create_dirs
1463 60aa1fa0 2022-03-17 op run_test test_patch_with_offset
1464 7a30b5cb 2022-03-20 op run_test test_patch_prefer_new_path
1465 b3c57ab2 2022-03-22 op run_test test_patch_no_newline
1466 9d6cabd5 2022-04-07 op run_test test_patch_strip
1467 ed3bff83 2022-04-23 op run_test test_patch_relative_paths
1468 15e1bda6 2022-04-23 op run_test test_patch_with_path_prefix
1469 15e1bda6 2022-04-23 op run_test test_patch_relpath_with_path_prefix
1470 bad961bf 2022-04-23 op run_test test_patch_reverse