bug-gnulib
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Update \(en in copyright notices


From: Bruno Haible
Subject: Re: Update \(en in copyright notices
Date: Sun, 18 Jun 2023 13:51:19 +0200

Hi Paul,

When I see this ChangeLog entry:

        Update \(en in copyright notices
        * build-aux/update-copyright (ndash_re): New var, matching \(en too.
        (stmt_remainder_re, stmt): Use it.
        (stmt): Match year in constructs like "\(en2023".
        (ndash): Now \(en in man pages.

I wonder: Where are the unit tests? So I'm adding 4 unit tests (see below):

- $TMP.1 for a man page that has the copyright notice in comments (such as
  coreutils/man/du.x).
- $TMP.2 for a man page that prints the copyright notice in a '.SH COPYRIGHT'
  section (such as coreutils/man/expr.1).
- $TMP.3 likewise but where the author used \(en.
- $TMP.4 likewise but where the update-copyright should recognize the man page
  syntax from the use of \(co and should therefore insert \(en instead of -.

But when I run the unit tests
  $ rm -rf testdir1; ./gnulib-tool --create-testdir --dir=testdir1 
--single-configure --symlink update-copyright
  $ cd testdir1
  $ ./configure
  $ make check

I get a test failure already in the previously existing test cases:

--- -   2023-06-18 13:36:41.853321053 +0200
+++ update-copyright.test-ex.1  2023-06-18 13:36:41.840832810 +0200
@@ -1,2 +1,2 @@
-Copyright @copyright{} 1990-2005, 2007-2010 Free Software Foundation,
-Inc.
+Copyright @copyright{} 1990\(en2005, 2007\(en2010 Free Software
+Foundation, Inc.
FAIL test-update-copyright.sh (exit status: 1)

It looks like the new code is inserting \(en in TeXinfo source files.


2023-06-18  Bruno Haible  <bruno@clisp.org>

        update-copyright tests: Add tests for man pages.
        * tests/test-update-copyright.sh: Add 4 tests that use man page syntax.

diff --git a/tests/test-update-copyright.sh b/tests/test-update-copyright.sh
index a84ae34512..5555aa3009 100755
--- a/tests/test-update-copyright.sh
+++ b/tests/test-update-copyright.sh
@@ -252,6 +252,43 @@ EOF
 
 rm $TMP*
 
+## ------------------------ ##
+## Examples from man pages  ##
+## ------------------------ ##
+
+TMP=$TMP_BASE-man
+cat > $TMP.1 <<EOF
+'\" Copyright (C) 1998-2009 Free Software Foundation, Inc.
+EOF
+cat > $TMP.2 <<EOF
+Copyright \(co 1998-2009 Free Software Foundation, Inc.
+EOF
+cat > $TMP.3 <<EOF
+Copyright \(co 1998\(en2009 Free Software Foundation, Inc.
+EOF
+cat > $TMP.4 <<EOF
+Copyright \(co 2009 Free Software Foundation, Inc.
+EOF
+
+UPDATE_COPYRIGHT_YEAR=2010 UPDATE_COPYRIGHT_USE_INTERVALS=1 \
+  update-copyright $TMP.? 1> $TMP-stdout 2> $TMP-stderr
+compare /dev/null $TMP-stdout || exit 1
+compare /dev/null $TMP-stderr || exit 1
+compare - $TMP.1 <<EOF || exit 1
+'\" Copyright (C) 1998-2010 Free Software Foundation, Inc.
+EOF
+compare - $TMP.2 <<EOF || exit 1
+Copyright \(co 1998-2010 Free Software Foundation, Inc.
+EOF
+compare - $TMP.3 <<EOF || exit 1
+Copyright \(co 1998\(en2010 Free Software Foundation, Inc.
+EOF
+compare - $TMP.4 <<EOF || exit 1
+Copyright \(co 2009\(en2010 Free Software Foundation, Inc.
+EOF
+
+rm $TMP*
+
 ## -------------- ##
 ## Current year.  ##
 ## -------------- ##






reply via email to

[Prev in Thread] Current Thread [Next in Thread]