xref: /openbsd/regress/usr.bin/rcs/Makefile (revision 404b540a)
1#	$OpenBSD: Makefile,v 1.41 2008/02/02 16:23:44 xsa Exp $
2
3# Regression tests by Niall O'Higgins <niallo@openbsd.org>.
4# ksh -> Makefile by Ray Lai <ray@cyth.net>.
5
6CI?=		ci
7CO?=		co
8MERGE?=		merge
9RCS?=		rcs
10RCSCLEAN?=	rcsclean
11RCSDIFF?=	rcsdiff
12RCSMERGE?=	rcsmerge
13RLOG?=		rlog
14
15DIFF=		diff -u
16
17CLEANFILES=	RCS blah.c blah.c,v description file1 file2 file3 \
18		file file,v newfile newfile,v test test,v \
19		test-truncated truncated.out foo foo,v bar bar,v
20
21# XXX - These may need to be done in order.
22#	(At least start with ci-initial.)
23LTESTS= ci-initial \
24	ci-mflag \
25	ci-lflag \
26	ci-rflag \
27	co-lflag \
28	ci-rev \
29	co-perm \
30	co-perm2 \
31	ci-perm \
32	ci-perm2 \
33	ci-dinvalid \
34	ci-dold \
35	ci-wflag \
36	rcsdiff-uflag \
37	rcsdiff-rflag \
38	rcs-mflag \
39	rcs-mflag2 \
40	co-RCSINIT \
41	ci-nflag \
42	ci-Nflag \
43	ci-sflag \
44	co-lflag2 \
45	rcsclean \
46	rcsdiff \
47	rcsdiff-symbols \
48	merge-eflag \
49	rcsmerge \
50	rcsmerge-symbols \
51	ci-dflag \
52	ci-xflag \
53	comma \
54	rcs-aflag \
55	rcs-eflag \
56	rcs-Aflag \
57	rcs-tflag-stdin \
58	rcs-tflag-stdin2 \
59	rcs-tflag-stdin3 \
60	rcs-tflag-inline \
61	rcs-tflag-file \
62	rcs-oflag \
63	rcs-lock-unlock \
64	co-lock-filemodes \
65	co-unlock-filemodes \
66	ci-filemodes \
67	rcs-iflag \
68	rlog-lflag \
69	rlog-rflag \
70	ci-nofile \
71	ci-revert \
72	ci-keywords \
73	ci-keywords2 \
74	ci-parse-keywords \
75	ci-parse-keywords2 \
76	co-parse-truncated \
77	ci-2files \
78
79.for t in ${LTESTS}
80REGRESS_TARGETS+=test-${t}
81.endfor
82
83test-ci-initial: clean
84	@echo 'this is a test file' > test
85	@echo "a test file" | ${CI} -q -l test
86	@grep -q 'this is a test file' test,v
87
88# Testing 'ci test' with non-interactive log message
89test-ci-mflag:
90	@echo 'another revision' >> test
91	@${CI} -q -m'a second revision' test
92	@test ! -e test
93	@grep -q 'another revision' test,v
94
95# Testing 'co -l test'
96test-ci-lflag:
97	@${CO} -q -l test
98	@test -e test
99
100# Testing 'ci -r1.30 test' with non-interactive log message
101test-ci-rflag:
102	@echo "new stuff" >> test
103	@${CI} -q -r1.30 -m'bumped rev' test
104	@test ! -e test
105
106# Testing 'co -l test'
107test-co-lflag:
108	@${CO} -q -l test
109	@test -e test
110
111# Testing 'ci test' (should be rev 1.31) with non-interactive log message
112test-ci-rev:
113	@echo "a third revision" >> test
114	@${CI} -q -m'this should be rev 1.31' test
115	@grep -q '1.31' test,v
116
117# Testing 'co -u test' - ensuring permissions are 0444
118test-co-perm:
119	@${CO} -q -u test
120	@eval 'test `stat -f%p test` = 100444'
121
122# Testing 'co -l test' - ensuring permissions are 0644
123test-co-perm2:
124	@rm -rf test
125	@${CO} -q -l test
126	@eval 'test `stat -f%p test` = 100644'
127
128# Testing 'ci -u' - ensuring permissions are 0444
129test-ci-perm:
130	@echo "a line for ci -u" >> test
131	@${CI} -q -m'message for ci -u' -u test
132	@eval 'test `stat -f%p test` = 100444'
133
134# Testing 'ci -l' - ensuring permissions are 0644
135test-ci-perm2:
136	@rm -rf test
137	@${CO} -q -l test
138	@echo "a line for ci -l" >> test
139	@${CI} -q -m'message for ci -l' -l test
140	@eval 'test `stat -f%p test` = 100644'
141
142# Testing ci with an invalid date
143test-ci-dinvalid:
144	@echo 'some text for invalid date text' >> test
145	@if @${CI} -q -d'an invalid date' -m'invalid date' -l test 2>/dev/null; then false; fi
146	@if grep 'some text for invalid date text' test,v; then false; fi
147
148# Testing ci with a date older than previous revision
149test-ci-dold:
150	@echo 'some text for old date test' >> test
151	@if ${CI} -q -d'1990-01-12 04:00:00+00' -m'old dated revision' -l test 2>/dev/null; then false; fi
152	@if grep 'some text for old date test' test,v; then false; fi
153
154# Testing ci -wtestuser
155test-ci-wflag:
156	@rm -rf test
157	@${CO} -q -l test
158	@echo "blah blah" >> test
159	@echo "output for ci -w" >> test
160	@${CI} -q -wtestuser -mcomment -l test
161	@grep -q 'author testuser' test,v
162
163# Testing 'rcsdiff -u test' after adding another line
164test-rcsdiff-uflag:
165	@echo "a line for rcsdiff test" >> test
166	@${RCSDIFF} -q -u test | tail -n 5 |		\
167	    ${DIFF} ${.CURDIR}/rcsdiff-uflag.out -
168
169# Testing 'rcsdiff -u -r1.2 test'
170test-rcsdiff-rflag:
171	@${RCSDIFF} -q -u -r1.2 test | tail -n +3 |	\
172	    ${DIFF} ${.CURDIR}/rcsdiff-rflag.out -
173
174# Testing 'rcs -m1.2:logmessage'
175test-rcs-mflag:
176	@${RCS} -q -m1.2:logmessage test
177	@grep -q 'logmessage' test,v
178
179# Testing 'rcs -m'1.2:a new log message''
180test-rcs-mflag2:
181	@${RCS} -q -m1.1:'a new log message, one which is quite long and set by rcsprog' test
182	@grep -q 'a new log message, one which is quite long and set by rcsprog' test,v
183
184# Testing RCSINIT environment variable
185test-co-RCSINIT:
186	@rm -rf test
187	@RCSINIT=-l ${CO} -q test
188	@eval 'test `stat -f%p test` = 100644'
189
190# Testing check-in with symbol
191test-ci-nflag:
192	@echo "something to check in with a symbol" >> test
193	@${CI} -q -n'symbolname' -m'test symbols' -l test
194	@grep -q 'symbolname' test,v
195
196# Testing check-in, forcing symbol
197test-ci-Nflag:
198	@echo "something to check in with a forced symbol" >> test
199	@${CI} -q -N'symbolname' -m'test force symbol' -l test
200	@grep -q 'test force symbol' test,v
201
202# Trying some jiggerypokery with state
203test-ci-sflag:
204	@echo "blahblah" >>  test
205	@if ${CI} -q -l -s'SPACE S' -m"state with a space" test; then false; fi
206	@if grep -q 'SPACE S' test,v; then false; fi
207
208# Trying to check it out
209test-co-lflag2:
210	@rm -rf test
211	@${CO} -q -l test
212	@test -e test
213
214test-rcsclean: clean
215	@touch file
216	@${RCSCLEAN} -q file
217	@${RCSCLEAN} -q1.1 file
218	@${RCSCLEAN} -qsym file
219	@test -f file
220
221	@echo . | ${CI} -q -nsym file
222	@${CO} -q file
223	@${RCSCLEAN} -q file
224	@test ! -f file
225	@${CO} -q file
226	@${RCSCLEAN} -q1.1 file
227	@test ! -f file
228	@${CO} -q file
229	@${RCSCLEAN} -qsym file
230	@test ! -f file
231
232	@${CO} -q -l file
233	@${RCSCLEAN} -q file
234	@test -f file
235	@${RCSCLEAN} -q -u file
236	@test ! -f file
237	@${CO} -q -l file
238	@echo change >> file
239	@${RCSCLEAN} -q file
240	@${RCSCLEAN} -q -u file
241	@test -f file
242
243test-merge-eflag: clean
244	@echo "line1\nline2\nfile1new" > file1
245	@echo "line1\nline2" > file2
246	@echo "line1\nfile3new\nline2" > file3
247	@${MERGE} -p -q -e file1 file2 file3 | \
248	    ${DIFF} ${.CURDIR}/merge-eflag.out -
249
250test-rcsmerge:
251	@cp -f ${.CURDIR}/rev1 blah.c
252	@echo "descr" | ${CI} -q -l -m"first rev" blah.c
253	@cp -f ${.CURDIR}/rev2 blah.c
254	@${CI} -q -l -m"second rev" blah.c
255	@cp -f ${.CURDIR}/rev3 blah.c
256	@${CI} -q -l -m"third rev" blah.c
257
258	@${RCSMERGE} -q -r1.1 -r1.3 -p blah.c |				\
259	    ${DIFF} ${.CURDIR}/rcsmerge.out -
260
261test-rcsmerge-symbols: clean
262	@mkdir RCS
263	@cp -f ${.CURDIR}/rev1 blah.c
264	@echo "descr" | ${CI} -q -l -nsym1 -m"first rev" blah.c
265	@cp -f ${.CURDIR}/rev2 blah.c
266	@${CI} -q -l -nsym2 -m"second rev" blah.c
267	@cp -f ${.CURDIR}/rev3 blah.c
268	@${CI} -q -l -nsym3 -m"third rev" blah.c
269
270	@${RCSMERGE} -q -rsym1 -rsym3 -p blah.c |		\
271	    ${DIFF} ${.CURDIR}/rcsmerge.out -
272
273test-rcsdiff:
274	@rm -rf blah.c,v
275
276	@cp -f ${.CURDIR}/rev1 blah.c
277	@echo "descr" | ${CI} -q -l -m"first rev" blah.c
278	@cp -f ${.CURDIR}/rev2 blah.c
279	@${CI} -q -l -m"second rev" blah.c
280	@cp -f ${.CURDIR}/rev3 blah.c
281	@${CI} -q -l -m"third rev" blah.c
282
283	@${RCSDIFF} -q -r1.1 -r1.3 -u blah.c | tail -n +3 |		\
284	    ${DIFF} ${.CURDIR}/rcsdiff.out -
285
286test-rcsdiff-symbols: clean
287	@mkdir RCS
288	@cp -f ${.CURDIR}/rev1 blah.c
289	@echo "descr" | ${CI} -q -l -nsym1 -m"first rev" blah.c
290	@cp -f ${.CURDIR}/rev2 blah.c
291	@${CI} -q -l -nsym2 -m"second rev" blah.c
292	@cp -f ${.CURDIR}/rev3 blah.c
293	@${CI} -q -l -nsym3 -m"third rev" blah.c
294
295	@${RCSDIFF} -q -rsym1 -rsym3 -u blah.c | tail -n +3 |		\
296	    ${DIFF} ${.CURDIR}/rcsdiff.out -
297
298# Testing 'ci -d'2037-01-12 04:00:00+00' -l test
299test-ci-dflag: clean
300	@echo "some text for date test" >> test
301	@echo . | ${CI} -q -d'2037-01-12 04:00:00+00' -m'dated revision' -l test
302	@grep -q 'dated revision' test,v
303
304test-ci-xflag:
305	@mkdir -p RCS
306	@rm -rf RCS/file*
307	@touch file
308	@echo . | ${CI} -q -x,abcd/,v file
309	@test -e RCS/file,abcd
310	@test ! -e RCS/file,v
311
312	@mv -f RCS/file,abcd RCS/file,v
313	@${CO} -q -l file
314	@echo revision >> file
315	@echo . | ${CI} -q -x,abcd/,v/xyz file
316	@test ! -e RCS/file,abcd
317	@fgrep -q revision RCS/file,v
318	@test ! -e RCS/filexyz
319
320	@touch file
321	@echo more >> file
322	@echo . | ${CI} -q -x file
323	@fgrep -q more RCS/file
324
325test-comma:
326	@rm -rf RCS
327	@mkdir -p RCS
328	@touch file,notext
329	@echo . | ${CI} -q file,notext
330	@test -e RCS/file,notext,v
331	@test ! -e RCS/file,v
332
333# Testing 'rcs -afoo,bar,baz'
334test-rcs-aflag: clean
335	@echo "." | ${RCS} -q -i test
336	@${RCS} -q -afoo,bar,baz test
337	@${RLOG} test | ${DIFF} ${.CURDIR}/rcs-aflag.out -
338
339# Testing 'rcs -efoo,bar,baz'
340test-rcs-eflag: test-rcs-aflag
341	@${RCS} -q -efoo,bar,baz test
342	@${RLOG} test | ${DIFF} ${.CURDIR}/rcs-eflag.out -
343
344# Testing  'rcs -Atest newfile'
345test-rcs-Aflag: test-rcs-aflag
346	@echo "." | ${RCS} -q -i newfile
347	@${RCS} -q -Atest newfile
348	@${RLOG} newfile | ${DIFF} ${.CURDIR}/rcs-Aflag.out -
349
350test-rcs-tflag-stdin: clean
351	@echo 'This is a description.' | ${RCS} -q -i -t file
352	@fgrep -q 'This is a description.' file,v
353
354test-rcs-tflag-stdin2: clean
355	@echo '.This is not the description end.' | ${RCS} -q -i -t file
356	@fgrep -q '.This is not the description end.' file,v
357
358test-rcs-tflag-stdin3: clean
359	@echo "This is the description end.\n.\nThis should not be here." | \
360	    ${RCS} -q -i -t file
361	@fgrep -q 'This should not be here.' file,v || \
362	    case "$$?" in 1) exit 0;; esac && exit 1
363
364test-rcs-tflag-inline: clean
365	@${RCS} -q -i '-t-This is a description.' file
366	@fgrep -q 'This is a description.' file,v
367
368test-rcs-tflag-file: clean
369	@echo 'This is a description.' > description
370	@${RCS} -q -i -tdescription file
371	@fgrep -q 'This is a description.' file,v
372
373# Testing deletion of ranges
374test-rcs-oflag: clean
375	@cp ${.CURDIR}/rev3 blah.c
376	@echo "blah" | ${CI} -q blah.c
377	@${CO} -q -l blah.c
378	@echo "blah2" >> blah.c
379	@echo "blah2" | ${CI} -q blah.c
380	@${CO} -q -l blah.c
381	@echo "blah3" >> blah.c
382	@echo "blah3" | ${CI} -q blah.c
383	@${CO} -q -l blah.c
384	@echo "blah4" >> blah.c
385	@echo "blah4" | ${CI} -q blah.c
386	@${CO} -q -l blah.c
387	@echo "blah5" >> blah.c
388	@echo "blah5" | ${CI} -q blah.c
389	@${CO} -q -l blah.c
390	@echo "blah6" >> blah.c
391	@echo "blah6" | ${CI} -q blah.c
392	@${CO} -q -l blah.c
393	@${RCS} -q -o1.3:1.5 blah.c
394	@tr '\n' ' ' < blah.c,v | grep -q '[[:space:]]1.3[[:space:]]' || \
395	    case "$$?" in 1) exit 0;; esac && exit 1
396	@tr '\n' ' ' < blah.c,v | grep -q '[[:space:]]1.4[[:space:]]' || \
397	    case "$$?" in 1) exit 0;; esac && exit 1
398	@tr '\n' ' ' < blah.c,v | grep -q '[[:space:]]1.5[[:space:]]' || \
399	    case "$$?" in 1) exit 0;; esac && exit 1
400
401test-rcs-lock-unlock: clean
402	@touch file
403	@mkdir -p RCS
404	@echo . | ${CI} -q -l file
405	@echo sometext > file
406	@echo . | ${CI} -q file
407
408	@${RCS} -q -l file
409	@${RLOG} file | fgrep -x -A 1 'locks: strict' | head -n 2 | fgrep -q 1.2
410	@${RCS} -q -u file
411	@${RLOG} file | fgrep -x -A 1 'locks: strict' | head -n 2 | fgrep -q 1.2 || \
412	    case "$$?" in 1) exit 0;; esac && exit 1
413
414	@${RCS} -q -l1.1 file
415	@${RLOG} file | fgrep -x -A 1 'locks: strict' | head -n 2 | fgrep -q 1.1
416	@${RCS} -q -u1.1 file
417	@${RLOG} file | fgrep -x -A 1 'locks: strict' | head -n 2 | fgrep -q 1.1 || \
418	    case "$$?" in 1) exit 0;; esac && exit 1
419
420	@${RCS} -q -l1.2 file
421	@${RLOG} file | fgrep -x -A 1 'locks: strict' | head -n 2 | fgrep -q 1.2
422	@${RCS} -q -u1.2 file
423	@${RLOG} file | fgrep -x -A 1 'locks: strict' | head -n 2 | fgrep -q 1.2 || \
424	    case "$$?" in 1) exit 0;; esac && exit 1
425
426	@${RCS} -q -u file
427	@${RCS} -q -l file
428	@${RCS} -q -l file
429	@${RCS} -q -l1.3 file || case "$$?" in 1) exit 0;; esac && exit 1
430	@${RCS} -q -u1.3 file || case "$$?" in 1) exit 0;; esac && exit 1
431
432# Testing 'co -l blah.c' for permissions inheritance
433test-co-lock-filemodes:
434	@rm -rf RCS/blah.c,v blah.c
435	@mkdir -p RCS
436	@cp ${.CURDIR}/rev3 blah.c
437	@chmod 444 blah.c
438	@echo "blah" | ${CI} -q blah.c
439	@chmod 755 RCS/blah.c,v
440	@${CO} -q -l blah.c
441	@eval 'test `stat -f%p blah.c` = 100755'
442	@rm -rf blah.c
443	@chmod 666 RCS/blah.c,v
444	@${CO} -q -l blah.c
445	@eval 'test `stat -f%p blah.c` = 100644'
446	@rm -rf blah.c
447	@chmod 600 RCS/blah.c,v
448	@${CO} -q -l blah.c
449	@eval 'test `stat -f%p blah.c` = 100600'
450	@rm -rf blah.c
451	@chmod 604 RCS/blah.c,v
452	@${CO} -q -l blah.c
453	@eval 'test `stat -f%p blah.c` = 100604'
454	@rm -rf blah.c
455	@chmod 754 RCS/blah.c,v
456	@${CO} -q -l blah.c
457	@eval 'test `stat -f%p blah.c` = 100754'
458
459
460# Testing 'co -u blah.c' for permissions inheritance
461test-co-unlock-filemodes: test-co-lock-filemodes
462	@rm -rf RCS/blah.c,v blah.c
463	@mkdir -p RCS
464	@cp ${.CURDIR}/rev3 blah.c
465	@echo "blah" | ${CI} -q blah.c
466	@chmod 755 RCS/blah.c,v
467	@${CO} -q -u blah.c
468	@eval 'test `stat -f%p blah.c` = 100555'
469	@rm -rf blah.c
470	@chmod 666 RCS/blah.c,v
471	@${CO} -q -u blah.c
472	@eval 'test `stat -f%p blah.c` = 100444'
473	@rm -rf blah.c
474	@chmod 600 RCS/blah.c,v
475	@${CO} -q -u blah.c
476	@eval 'test `stat -f%p blah.c` = 100400'
477	@rm -rf blah.c
478	@chmod 604 RCS/blah.c,v
479	@${CO} -q -u blah.c
480	@eval 'test `stat -f%p blah.c` = 100404'
481	@rm -rf blah.c
482	@chmod 754 RCS/blah.c,v
483	@${CO} -q -u blah.c
484	@eval 'test `stat -f%p blah.c` = 100554'
485
486# Testing 'ci blah.c' for permissions inheritance
487test-ci-filemodes: test-co-unlock-filemodes
488	@rm -rf RCS/blah.c,v blah.c
489	@mkdir -p RCS
490	@cp ${.CURDIR}/rev3 blah.c
491	@chmod 755 blah.c
492	@echo "blah" | ${CI} -q blah.c
493	@eval 'test `stat -f%p RCS/blah.c,v` = 100555'
494	@rm -rf RCS/blah.c,v blah.c
495	@cp ${.CURDIR}/rev3 blah.c
496	@chmod 666 blah.c
497	@echo "blah" | ${CI} -q blah.c
498	@eval 'test `stat -f%p RCS/blah.c,v` = 100444'
499	@rm -rf RCS/blah.c,v blah.c
500	@cp ${.CURDIR}/rev3 blah.c
501	@chmod 700 blah.c
502	@echo "blah" | ${CI} -q blah.c
503	@eval 'test `stat -f%p RCS/blah.c,v` = 100500'
504	@rm -rf RCS/blah.c,v blah.c
505	@cp ${.CURDIR}/rev3 blah.c
506	@chmod 606 blah.c
507	@echo "blah" | ${CI} -q blah.c
508	@eval 'test `stat -f%p RCS/blah.c,v` = 100404'
509
510# Test various operations on a file with no revisions.
511test-rcs-iflag: clean
512	@mkdir -p RCS
513	@echo . | ${RCS} -i -q file
514	@test -f RCS/file,v
515	@${CO} -q file
516	@test -f file
517	@test ! -s file
518	@rm -f file
519	@${CO} -q -l file
520	@echo text >> file
521	@${CI} -q file
522	@fgrep -q 1.1 RCS/file,v
523
524test-rlog-lflag: clean
525	@mkdir RCS
526	@touch file
527	@echo rev1 | ${CI} -q -l file
528	@${RLOG} -l file | fgrep -q 'revision 1.1'
529	@echo line >> file
530	@echo rev2 | ${CI} -q file
531	@${RLOG} -l file | fgrep -q 'revision 1.2' ||	\
532	    case "$$?" in 1) exit 0;; esac && exit 1
533
534# Test various cases for the -r flag
535test-rlog-rflag: clean
536	@touch file
537	@echo "foo" > file
538	@echo "descr" | ${CI} -q -m"first rev" -d'2006-01-01 00:00:00+00' \
539		-wfoo file
540	@${CO} -q -l file
541	@echo "foo" >> file
542	@${CI} -q -m"second rev" -d'2006-01-01 00:00:00+00' -wfoo file
543	@${CO} -q -l file
544	@echo "foo" >> file
545	@${CI} -q -m"third rev" -d'2006-01-01 00:00:00+00' -wfoo file
546
547	@${RLOG} -r1.1 file | ${DIFF} ${.CURDIR}/rlog-rflag1.out -
548	@${RLOG} -r1.1:1.3 file | ${DIFF} ${.CURDIR}/rlog-rflag2.out -
549	@${RLOG} -r1.2: file | ${DIFF} ${.CURDIR}/rlog-rflag3.out -
550	@${RLOG} -r:1.1 file | ${DIFF} ${.CURDIR}/rlog-rflag4.out -
551
552test-rlog-zflag: clean
553	@touch file
554	@echo "descr" | ${CI} -q -m"first rev" -d'2006-01-01 00:00:00+00' \
555		-wfoo file
556	@${RLOG} -zLT file | ${DIFF} ${.CURDIR}/rlog-zflag1.out -
557	@${RLOG} -z+03:14:23 file | ${DIFF} ${.CURDIR}/rlog-zflag2.out -
558	@${RLOG} -z+03:14 file | ${DIFF} ${.CURDIR}/rlog-zflag3.out -
559	@${RLOG} -z+0314 file | ${DIFF} ${.CURDIR}/rlog-zflag4.out -
560	@${RLOG} -z-03:14:23 file | ${DIFF} ${.CURDIR}/rlog-zflag5.out -
561
562test-ci-nofile:
563	@${CI} -q nonexistent || case "$$?" in 1) exit 0;; esac && exit 1
564
565test-ci-revert: clean
566	@mkdir RCS
567	@touch file
568	@echo . | ${CI} -q -l file
569	@${CI} -q -mm -l file
570	@# Make sure reverting doesn't unlock file.
571	@${CI} -q -mm -l file
572
573test-ci-keywords: clean
574	@mkdir RCS
575	@sed 's/.*/$$&$$/' ${.CURDIR}/keywords.in > file
576	@sed 's/^[A-Z][A-Z]*[a-z][a-z]*: .*/$$&$$/' ${.CURDIR}/keywords.out > newfile
577	@echo . | ${CI} -q -u file
578	@sed -e 's,${USER},USER,' -e "s/\($$[A-Z][a-z]*: \).*file,v/\1file,v/" \
579	    -e 's,[0-9][0-9][0-9][0-9]/[0-9][0-9]/[0-9][0-9] [0-9][0-9]:[0-9][0-9]:[0-9][0-9],YYYY/MM/DD HH:MI:SS,' \
580	    file | ${DIFF} newfile -
581
582# Lots of expansion.
583test-ci-keywords2: clean
584	@perl -e 'print "\$$Id\$$\n" x 10000;' > file
585	@echo . | ${CI} -l -q file
586
587test-ci-parse-keywords: clean
588	@echo '$Id' > test
589	@echo . | ${CI} -q -k test
590
591test-ci-parse-keywords2: clean
592	@echo '$Id: blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah' > test
593	@echo . | ${CI} -q -k test
594
595# Check for correct EOF handling in rcs parser
596test-co-parse-truncated: clean
597	@sh -c 'ulimit -d 5000 && ${CO} -q ${.CURDIR}/test-truncated > truncated.out 2>&1' || \
598	    case "$$?" in 1) exit 0;; esac && exit 1
599	@grep -q 'co: problem parsing deltatexts' truncated.out
600
601test-ci-2files: clean
602	@touch foo bar
603	@${CI} -q -t-first -l foo
604	@test -f foo,v -a ! -f bar,v
605	@${CI} -q -t-second -l foo bar
606	@test -f foo,v -a -f bar,v
607
608clean:
609	@rm -rf ${CLEANFILES}
610
611.include <bsd.regress.mk>
612