update-copyright test: Improve output when perl is missing or too old.
[gnulib.git] / tests / test-update-copyright.sh
1 #!/bin/sh
2 # Test suite for update-copyright.
3 # Copyright (C) 2009-2010 Free Software Foundation, Inc.
4 # This file is part of the GNUlib Library.
5 #
6 # This program is free software: you can redistribute it and/or modify
7 # it under the terms of the GNU General Public License as published by
8 # the Free Software Foundation; either version 3 of the License, or
9 # (at your option) any later version.
10 #
11 # This program is distributed in the hope that it will be useful,
12 # but WITHOUT ANY WARRANTY; without even the implied warranty of
13 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14 # GNU General Public License for more details.
15 #
16 # You should have received a copy of the GNU General Public License
17 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
18
19 diffout=`diff -u /dev/null /dev/null 2>&1`
20 if test x"$diffout" = x"" && test $? -eq 0; then
21   compare() { diff -u "$@"; }
22 else
23   compare() { cmp "$@"; }
24 fi
25
26 # Ensure the update-copyright program gets found.
27 PATH=$abs_aux_dir:$PATH
28
29 TMP_BASE=update-copyright.test
30 trap 'rm -f $TMP_BASE*' 0 1 2 3 15
31
32 ## --------------------------------- ##
33 ## Skip if user does not have perl.  ##
34 ## --------------------------------- ##
35
36 TMP=$TMP_BASE
37 s=$TMP-script
38 cat <<\EOF > $s
39 eval '(exit $?0)' && eval 'exec perl -wS -0777 -pi "$0" ${1+"$@"}'
40   & eval 'exec perl -wS -0777 -pi "$0" $argv:q'
41     if 0;
42 s/a/b/
43 EOF
44 chmod a+x $s
45 echo a > $TMP-in
46 ./$s $TMP-in 2>/dev/null && test b = "`cat $TMP-in 2>/dev/null`" ||
47   {
48     printf '%s\n' "$0: skipping this test;" \
49       'your system has insufficient support for Perl' 1>&2
50     exit 77
51   }
52
53 # Skip this test if Perl is too old.  FIXME: 5.8.0 is just a guess.
54 # We have a report that 5.6.1 is inadequate and that 5.8.0 works.
55 perl -e 'require 5.8.0' || {
56   echo '$0: skipping this test; Perl version is too old' 1>&2
57   exit 77
58 }
59
60 # Do not let a different envvar setting perturb results.
61 UPDATE_COPYRIGHT_MAX_LINE_LENGTH=72
62 export UPDATE_COPYRIGHT_MAX_LINE_LENGTH
63
64 ## ----------------------------- ##
65 ## Examples from documentation.  ##
66 ## ----------------------------- ##
67
68 TMP=$TMP_BASE-ex
69 cat > $TMP.1 <<EOF
70 Copyright @copyright{} 1990-2005, 2007-2009 Free Software
71 Foundation, Inc.
72 EOF
73 cat > $TMP.2 <<EOF
74 # Copyright (C) 1990-2005, 2007-2009 Free Software
75 # Foundation, Inc.
76 EOF
77 cat > $TMP.3 <<EOF
78 /*
79  * Copyright &copy; 90,2005,2007-2009
80  * Free Software Foundation, Inc.
81  */
82 EOF
83 cat > $TMP.4 <<EOF
84 ## Copyright (C) 1990-2005, 2007-2009 Free Software
85 #  Foundation, Inc.
86 EOF
87 cat > $TMP.5 <<EOF
88 Copyright (C) 1990-2005, 2007-2009 Acme, Inc.
89 EOF
90 cat > $TMP.6 <<EOF
91 ## Copyright (C) 1990-2005, 2007-2009 Free Software
92 #  Foundation, Inc.
93
94 Copyright (C) 1990-2005, 2007-2009 Free Software Foundation,
95 Inc.
96 EOF
97 cat > $TMP.7 <<EOF
98 Copyright (C) 1990-2005, 2007-2009 Acme, Inc.
99
100 # Copyright (C) 1990-2005, 2007-2009 Free Software
101 # Foundation, Inc.
102 EOF
103
104 rm -f $TMP.*.bak
105 UPDATE_COPYRIGHT_YEAR=2009 \
106   update-copyright $TMP.* 1> $TMP-stdout 2> $TMP-stderr
107 compare /dev/null $TMP-stdout || exit 1
108 compare - $TMP-stderr <<EOF || exit 1
109 $TMP.4: warning: FSF copyright statement not found
110 $TMP.5: warning: FSF copyright statement not found
111 EOF
112 compare - $TMP.1 <<EOF || exit 1
113 Copyright @copyright{} 1990-2005, 2007-2009 Free Software
114 Foundation, Inc.
115 EOF
116 compare - $TMP.2 <<EOF || exit 1
117 # Copyright (C) 1990-2005, 2007-2009 Free Software
118 # Foundation, Inc.
119 EOF
120 compare - $TMP.3 <<EOF || exit 1
121 /*
122  * Copyright &copy; 90,2005,2007-2009
123  * Free Software Foundation, Inc.
124  */
125 EOF
126 compare - $TMP.4 <<EOF || exit 1
127 ## Copyright (C) 1990-2005, 2007-2009 Free Software
128 #  Foundation, Inc.
129 EOF
130 compare - $TMP.5 <<EOF || exit 1
131 Copyright (C) 1990-2005, 2007-2009 Acme, Inc.
132 EOF
133 compare - $TMP.6 <<EOF || exit 1
134 ## Copyright (C) 1990-2005, 2007-2009 Free Software
135 #  Foundation, Inc.
136
137 Copyright (C) 1990-2005, 2007-2009 Free Software Foundation,
138 Inc.
139 EOF
140 compare - $TMP.7 <<EOF || exit 1
141 Copyright (C) 1990-2005, 2007-2009 Acme, Inc.
142
143 # Copyright (C) 1990-2005, 2007-2009 Free Software
144 # Foundation, Inc.
145 EOF
146
147 rm -f $TMP.*.bak
148 UPDATE_COPYRIGHT_YEAR=2010 UPDATE_COPYRIGHT_USE_INTERVALS=1 \
149   update-copyright $TMP.* 1> $TMP-stdout 2> $TMP-stderr
150 compare /dev/null $TMP-stdout || exit 1
151 compare - $TMP-stderr <<EOF || exit 1
152 $TMP.4: warning: FSF copyright statement not found
153 $TMP.5: warning: FSF copyright statement not found
154 EOF
155 compare - $TMP.1 <<EOF || exit 1
156 Copyright @copyright{} 1990-2005, 2007-2010 Free Software Foundation,
157 Inc.
158 EOF
159 compare - $TMP.2 <<EOF || exit 1
160 # Copyright (C) 1990-2005, 2007-2010 Free Software Foundation, Inc.
161 EOF
162 compare - $TMP.3 <<EOF || exit 1
163 /*
164  * Copyright &copy; 1990, 2005, 2007-2010 Free Software Foundation, Inc.
165  */
166 EOF
167 compare - $TMP.4 <<EOF || exit 1
168 ## Copyright (C) 1990-2005, 2007-2009 Free Software
169 #  Foundation, Inc.
170 EOF
171 compare - $TMP.5 <<EOF || exit 1
172 Copyright (C) 1990-2005, 2007-2009 Acme, Inc.
173 EOF
174 compare - $TMP.6 <<EOF || exit 1
175 ## Copyright (C) 1990-2005, 2007-2009 Free Software
176 #  Foundation, Inc.
177
178 Copyright (C) 1990-2005, 2007-2010 Free Software Foundation, Inc.
179 EOF
180 compare - $TMP.7 <<EOF || exit 1
181 Copyright (C) 1990-2005, 2007-2009 Acme, Inc.
182
183 # Copyright (C) 1990-2005, 2007-2010 Free Software Foundation, Inc.
184 EOF
185
186 rm -f $TMP.*.bak
187 UPDATE_COPYRIGHT_YEAR=2010 UPDATE_COPYRIGHT_FORCE=1 \
188   update-copyright $TMP.* 1> $TMP-stdout 2> $TMP-stderr
189 compare /dev/null $TMP-stdout || exit 1
190 compare - $TMP-stderr <<EOF || exit 1
191 $TMP.4: warning: FSF copyright statement not found
192 $TMP.5: warning: FSF copyright statement not found
193 EOF
194 compare - $TMP.1 <<EOF || exit 1
195 Copyright @copyright{} 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997,
196 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2007, 2008, 2009, 2010
197 Free Software Foundation, Inc.
198 EOF
199 compare - $TMP.2 <<EOF || exit 1
200 # Copyright (C) 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998,
201 # 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2007, 2008, 2009, 2010 Free
202 # Software Foundation, Inc.
203 EOF
204 compare - $TMP.3 <<EOF || exit 1
205 /*
206  * Copyright &copy; 1990, 2005, 2007, 2008, 2009, 2010 Free Software
207  * Foundation, Inc.
208  */
209 EOF
210 compare - $TMP.4 <<EOF || exit 1
211 ## Copyright (C) 1990-2005, 2007-2009 Free Software
212 #  Foundation, Inc.
213 EOF
214 compare - $TMP.5 <<EOF || exit 1
215 Copyright (C) 1990-2005, 2007-2009 Acme, Inc.
216 EOF
217 compare - $TMP.6 <<EOF || exit 1
218 ## Copyright (C) 1990-2005, 2007-2009 Free Software
219 #  Foundation, Inc.
220
221 Copyright (C) 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998,
222 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2007, 2008, 2009, 2010 Free
223 Software Foundation, Inc.
224 EOF
225 compare - $TMP.7 <<EOF || exit 1
226 Copyright (C) 1990-2005, 2007-2009 Acme, Inc.
227
228 # Copyright (C) 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998,
229 # 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2007, 2008, 2009, 2010 Free
230 # Software Foundation, Inc.
231 EOF
232
233 rm $TMP*
234
235 ## -------------- ##
236 ## Current year.  ##
237 ## -------------- ##
238
239 TMP=$TMP_BASE-current-year
240 YEAR=`date +%Y`
241 cat > $TMP <<EOF
242 '\" Copyright (C) 2006
243 '\" Free Software Foundation,
244 '\" Inc.
245 EOF
246 update-copyright $TMP 1> $TMP-stdout 2> $TMP-stderr
247 compare /dev/null $TMP-stdout || exit 1
248 compare /dev/null $TMP-stderr || exit 1
249 compare - $TMP <<EOF || exit 1
250 '\" Copyright (C) 2006, $YEAR Free Software Foundation, Inc.
251 EOF
252 UPDATE_COPYRIGHT_USE_INTERVALS=1 \
253   update-copyright $TMP 1> $TMP-stdout 2> $TMP-stderr
254 compare /dev/null $TMP-stdout || exit 1
255 compare /dev/null $TMP-stderr || exit 1
256 compare - $TMP <<EOF || exit 1
257 '\" Copyright (C) 2006, $YEAR Free Software Foundation, Inc.
258 EOF
259 rm $TMP*
260
261 ## ------------------ ##
262 ## Surrounding text.  ##
263 ## ------------------ ##
264
265 TMP=$TMP_BASE-surrounding-text
266 cat > $TMP <<EOF
267     Undisturbed text.
268 dnl Undisturbed text.
269 dnl Copyright (C) 89
270 dnl Free Software Foundation, Inc.
271 dnl   Undisturbed text.
272 EOF
273 UPDATE_COPYRIGHT_YEAR=2010 \
274   update-copyright $TMP 1> $TMP-stdout 2> $TMP-stderr
275 compare /dev/null $TMP-stdout || exit 1
276 compare /dev/null $TMP-stderr || exit 1
277 compare - $TMP <<EOF || exit 1
278     Undisturbed text.
279 dnl Undisturbed text.
280 dnl Copyright (C) 1989, 2010 Free Software Foundation, Inc.
281 dnl   Undisturbed text.
282 EOF
283 rm $TMP*
284
285 ## --------------- ##
286 ## Widest prefix.  ##
287 ## --------------- ##
288
289 TMP=$TMP_BASE-widest-prefix
290 cat > $TMP <<EOF
291 #### Copyright (C) 1976, 1977, 1978, 1979, 1980, 1981, 1982, 1983, 1984, 1985,
292 #### 1986, 1987, 1988, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007,
293 #### 2008 Free Software Foundation, Inc.
294 EOF
295 UPDATE_COPYRIGHT_YEAR=2010 \
296   update-copyright $TMP 1> $TMP-stdout 2> $TMP-stderr
297 compare /dev/null $TMP-stdout || exit 1
298 compare /dev/null $TMP-stderr || exit 1
299 compare - $TMP <<EOF || exit 1
300 #### Copyright (C) 1976, 1977, 1978, 1979, 1980, 1981, 1982, 1983, 1984,
301 #### 1985, 1986, 1987, 1988, 1999, 2000, 2001, 2002, 2003, 2004, 2005,
302 #### 2006, 2007, 2008, 2010 Free Software Foundation, Inc.
303 EOF
304 UPDATE_COPYRIGHT_YEAR=2011 UPDATE_COPYRIGHT_USE_INTERVALS=1 \
305   update-copyright $TMP 1> $TMP-stdout 2> $TMP-stderr
306 compare /dev/null $TMP-stdout || exit 1
307 compare /dev/null $TMP-stderr || exit 1
308 compare - $TMP <<EOF || exit 1
309 #### Copyright (C) 1976-1988, 1999-2008, 2010-2011 Free Software
310 #### Foundation, Inc.
311 EOF
312 rm $TMP*
313
314 ## ------------------- ##
315 ## Prefix too large.  ##
316 ## ------------------- ##
317
318 TMP=$TMP_BASE-prefix-too-large
319 cat > $TMP <<EOF
320 ####  Copyright (C) 1976, 1977, 1978, 1979, 1980, 1981, 1982, 1983, 1984, 1985,
321 ####  1986, 1987, 1988, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007,
322 ####  2008 Free Software Foundation, Inc.
323 EOF
324 UPDATE_COPYRIGHT_YEAR=2010 \
325   update-copyright $TMP 1> $TMP-stdout 2> $TMP-stderr
326 compare /dev/null $TMP-stdout || exit 1
327 compare - $TMP-stderr <<EOF || exit 1
328 $TMP: warning: FSF copyright statement not found
329 EOF
330 compare - $TMP <<EOF || exit 1
331 ####  Copyright (C) 1976, 1977, 1978, 1979, 1980, 1981, 1982, 1983, 1984, 1985,
332 ####  1986, 1987, 1988, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007,
333 ####  2008 Free Software Foundation, Inc.
334 EOF
335 rm $TMP*
336
337 ## ------------- ##
338 ## Blank lines.  ##
339 ## ------------- ##
340
341 TMP=$TMP_BASE-blank-lines
342 cat > $TMP <<EOF
343 #Copyright (C) 1976, 1977, 1978, 1979, 1980, 1981, 1982, 1983, 1984, 1985,
344 #
345 #1986, 1987, 1988, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007,
346 #2008 Free Software Foundation, Inc.
347
348 Copyright (C) 1976, 1977, 1978, 1979, 1980, 1981, 1982, 1983, 1984, 1985,
349
350 1986, 1987, 1988, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007,
351 2008 Free Software Foundation, Inc.
352 EOF
353 UPDATE_COPYRIGHT_YEAR=2010 \
354   update-copyright $TMP 1> $TMP-stdout 2> $TMP-stderr
355 compare /dev/null $TMP-stdout || exit 1
356 compare - $TMP-stderr <<EOF || exit 1
357 $TMP: warning: FSF copyright statement not found
358 EOF
359 compare - $TMP <<EOF || exit 1
360 #Copyright (C) 1976, 1977, 1978, 1979, 1980, 1981, 1982, 1983, 1984, 1985,
361 #
362 #1986, 1987, 1988, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007,
363 #2008 Free Software Foundation, Inc.
364
365 Copyright (C) 1976, 1977, 1978, 1979, 1980, 1981, 1982, 1983, 1984, 1985,
366
367 1986, 1987, 1988, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007,
368 2008 Free Software Foundation, Inc.
369 EOF
370 rm $TMP*
371
372 ## -------------- ##
373 ## Leading tabs.  ##
374 ## -------------- ##
375
376 TMP=$TMP_BASE-leading-tabs
377 cat > $TMP <<EOF
378         Copyright (C) 87, 88, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 98,
379          1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free
380         Software Foundation, Inc.
381 EOF
382 UPDATE_COPYRIGHT_YEAR=2010 \
383   update-copyright $TMP 1> $TMP-stdout 2> $TMP-stderr
384 compare /dev/null $TMP-stdout || exit 1
385 compare /dev/null $TMP-stderr || exit 1
386 compare - $TMP <<EOF || exit 1
387         Copyright (C) 1987, 1988, 1991, 1992, 1993, 1994, 1995, 1996,
388         1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006,
389         2007, 2008, 2009, 2010 Free Software Foundation, Inc.
390 EOF
391 UPDATE_COPYRIGHT_YEAR=2011 UPDATE_COPYRIGHT_USE_INTERVALS=1 \
392   update-copyright $TMP 1> $TMP-stdout 2> $TMP-stderr
393 compare /dev/null $TMP-stdout || exit 1
394 compare /dev/null $TMP-stderr || exit 1
395 compare - $TMP <<EOF || exit 1
396         Copyright (C) 1987-1988, 1991-2011 Free Software Foundation,
397         Inc.
398 EOF
399 rm $TMP*
400
401 ## -------------------- ##
402 ## Unusual whitespace.  ##
403 ## -------------------- ##
404
405 TMP=$TMP_BASE-unusual-ws
406 cat > $TMP <<EOF
407                 # Copyright (C) 87-88, 1991, 1992, 1993, 1994, 1995, 1996, 1997,
408                 # 98, 1999, 2000, 2001, 2002, 2003,             \f         2004, 2005, 2006, 2007, 2008,
409                 # 2009 Free Software Foundation, Inc.
410 EOF
411 UPDATE_COPYRIGHT_YEAR=2010 \
412   update-copyright $TMP 1> $TMP-stdout 2> $TMP-stderr
413 compare /dev/null $TMP-stdout || exit 1
414 compare /dev/null $TMP-stderr || exit 1
415 compare - $TMP <<EOF || exit 1
416                 # Copyright (C) 1987, 1988, 1991, 1992, 1993, 1994,
417                 # 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003,
418                 # 2004, 2005, 2006, 2007, 2008, 2009, 2010 Free Software
419                 # Foundation, Inc.
420 EOF
421 UPDATE_COPYRIGHT_YEAR=2011 UPDATE_COPYRIGHT_USE_INTERVALS=1 \
422   update-copyright $TMP 1> $TMP-stdout 2> $TMP-stderr
423 compare /dev/null $TMP-stdout || exit 1
424 compare /dev/null $TMP-stderr || exit 1
425 compare - $TMP <<EOF || exit 1
426                 # Copyright (C) 1987-1988, 1991-2011 Free Software
427                 # Foundation, Inc.
428 EOF
429 rm $TMP*
430
431 ## --------- ##
432 ## DOS EOL.  ##
433 ## --------- ##
434
435 TMP=$TMP_BASE-dos-eol
436 tr @ '\015' > $TMP <<\EOF
437 Rem Copyright (C) 87, 88, 1991, 1992, 1993, 1994, 1995, 1996, 1997,@
438 Rem 98, 1999, 2000, 2001, 2002, 2003,  2004, 2005, 2006, 2007, 2008,@
439 Rem 2009 Free Software Foundation, Inc.@
440 EOF
441 UPDATE_COPYRIGHT_YEAR=2010 \
442   update-copyright $TMP 1> $TMP-stdout 2> $TMP-stderr
443 compare /dev/null $TMP-stdout || exit 1
444 compare /dev/null $TMP-stderr || exit 1
445 tr @ '\015' > $TMP-exp <<\EOF
446 Rem Copyright (C) 1987, 1988, 1991, 1992, 1993, 1994, 1995, 1996, 1997,@
447 Rem 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008,@
448 Rem 2009, 2010 Free Software Foundation, Inc.@
449 EOF
450 compare $TMP-exp $TMP || exit 1
451 rm $TMP*
452
453 ## --------------- ##
454 ## Omitted "(C)".  ##
455 ## --------------- ##
456
457 TMP=$TMP_BASE-omitted-circle-c
458 cat > $TMP <<EOF
459   Copyright 87, 88, 1991, 1992, 1993, 1994, 1995, 1996, 1997,
460   98, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008,
461   2009 Free Software Foundation, Inc.
462 EOF
463 UPDATE_COPYRIGHT_YEAR=2010 \
464   update-copyright $TMP 1> $TMP-stdout 2> $TMP-stderr
465 compare /dev/null $TMP-stdout || exit 1
466 compare /dev/null $TMP-stderr || exit 1
467 compare - $TMP <<EOF || exit 1
468   Copyright 1987, 1988, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998,
469   1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010
470   Free Software Foundation, Inc.
471 EOF
472 rm $TMP*
473
474 ## ------------------ ##
475 ## C-style comments.  ##
476 ## ------------------ ##
477
478 TMP=$TMP_BASE-c-style-comments
479 cat > $TMP.star <<EOF
480 /*  Copyright 87, 88, 1991, 1992, 1993, 1994, 1995, 1996, 1997,
481  *  98, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008,
482  *  2009 Free Software Foundation, Inc.  */
483 EOF
484 cat > $TMP.space <<EOF
485   /*Copyright 87, 88, 1991, 1992, 1993, 1994, 1995, 1996, 1997,
486     98, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008,
487     2009 Free Software Foundation, Inc.  */
488 EOF
489 cat > $TMP.single-line <<EOF
490 /*   Copyright 87, 1991, 1992 Free Software Foundation, Inc.  */
491 EOF
492 cat > $TMP.single-line-wrapped <<EOF
493  /* Copyright 1988, 1991, 1992, 1993 Free Software Foundation, Inc.  */
494 EOF
495 cat > $TMP.extra-text-star <<EOF
496  /* Copyright 1987, 1988, 1991, 1992 Free Software Foundation, Inc.  End
497   * More comments.  */
498 EOF
499 cat > $TMP.extra-text-space <<EOF
500  /* Copyright 1987, 1988, 1991, 1992 Free Software Foundation, Inc. ***
501     * End of comments. */
502 EOF
503 UPDATE_COPYRIGHT_YEAR=2010 \
504   update-copyright $TMP.* 1> $TMP-stdout 2> $TMP-stderr
505 compare /dev/null $TMP-stdout || exit 1
506 compare /dev/null $TMP-stderr || exit 1
507 compare - $TMP.star <<EOF || exit 1
508 /*  Copyright 1987, 1988, 1991, 1992, 1993, 1994, 1995, 1996, 1997,
509  *  1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008,
510  *  2009, 2010 Free Software Foundation, Inc.  */
511 EOF
512 compare - $TMP.space <<EOF || exit 1
513   /*Copyright 1987, 1988, 1991, 1992, 1993, 1994, 1995, 1996, 1997,
514     1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008,
515     2009, 2010 Free Software Foundation, Inc.  */
516 EOF
517 compare - $TMP.single-line <<EOF || exit 1
518 /*   Copyright 1987, 1991, 1992, 2010 Free Software Foundation, Inc.  */
519 EOF
520 compare - $TMP.single-line-wrapped <<EOF || exit 1
521  /* Copyright 1988, 1991, 1992, 1993, 2010 Free Software Foundation,
522   * Inc.  */
523 EOF
524 compare - $TMP.extra-text-star <<EOF || exit 1
525  /* Copyright 1987, 1988, 1991, 1992, 2010 Free Software Foundation,
526   * Inc.  End
527   * More comments.  */
528 EOF
529 compare - $TMP.extra-text-space <<EOF || exit 1
530  /* Copyright 1987, 1988, 1991, 1992, 2010 Free Software Foundation,
531     Inc. ***
532     * End of comments. */
533 EOF
534 rm $TMP*
535
536 exit 0