groff-commit
[Top][All Lists]
Advanced

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

[groff] 29/30: [man]: Coalesce some tests.


From: G. Branden Robinson
Subject: [groff] 29/30: [man]: Coalesce some tests.
Date: Sat, 12 Oct 2024 12:07:56 -0400 (EDT)

gbranden pushed a commit to branch master
in repository groff.

commit 66fa00bedaf6a3475616c60208de33ccde1e87e6
Author: G. Branden Robinson <g.branden.robinson@gmail.com>
AuthorDate: Sat Oct 12 09:56:28 2024 -0500

    [man]: Coalesce some tests.
    
    * tmac/tests/an_CS-register-off.sh:
    * tmac/tests/an_CS-register-on.sh:
    * tmac/tests/an_CS-register-unspecified.sh:
    * tmac/tests/an_CT-register-off.sh:
    * tmac/tests/an_CT-register-on.sh:
    * tmac/tests/an_CT-register-unspecified.sh: Delete files, replacing
      with...
    
    * tmac/tests/an_CS-register-works.sh:
    * tmac/tests/an_CT-register-works.sh: ...these new files.
    
    * tmac/tmac.am (tmac_TESTS): Update.
---
 ChangeLog                                | 16 ++++++++++
 tmac/tests/an_CS-register-off.sh         | 27 ----------------
 tmac/tests/an_CS-register-on.sh          | 27 ----------------
 tmac/tests/an_CS-register-unspecified.sh | 27 ----------------
 tmac/tests/an_CS-register-works.sh       | 55 ++++++++++++++++++++++++++++++++
 tmac/tests/an_CT-register-off.sh         | 27 ----------------
 tmac/tests/an_CT-register-on.sh          | 27 ----------------
 tmac/tests/an_CT-register-unspecified.sh | 27 ----------------
 tmac/tests/an_CT-register-works.sh       | 55 ++++++++++++++++++++++++++++++++
 tmac/tmac.am                             |  8 ++---
 10 files changed, 128 insertions(+), 168 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index e633f013b..ad01d1e7d 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,19 @@
+2024-10-12  G. Branden Robinson <g.branden.robinson@gmail.com>
+
+       [man]: Coalesce some tests.
+
+       * tmac/tests/an_CS-register-off.sh:
+       * tmac/tests/an_CS-register-on.sh:
+       * tmac/tests/an_CS-register-unspecified.sh:
+       * tmac/tests/an_CT-register-off.sh:
+       * tmac/tests/an_CT-register-on.sh:
+       * tmac/tests/an_CT-register-unspecified.sh: Delete files,
+       replacing with...
+       * tmac/tests/an_CS-register-works.sh:
+       * tmac/tests/an_CT-register-works.sh: ...these new files.
+
+       * tmac/tmac.am (tmac_TESTS): Update.
+
 2024-10-11  G. Branden Robinson <g.branden.robinson@gmail.com>
 
        * tmac/an.tmac (AT, UC): Fix code style nits.  In formatted
diff --git a/tmac/tests/an_CS-register-off.sh b/tmac/tests/an_CS-register-off.sh
deleted file mode 100755
index 0b615da35..000000000
--- a/tmac/tests/an_CS-register-off.sh
+++ /dev/null
@@ -1,27 +0,0 @@
-#!/bin/sh
-#
-# Copyright (C) 2019-2020 Free Software Foundation, Inc.
-#
-# This file is part of groff.
-#
-# groff is free software; you can redistribute it and/or modify it under
-# the terms of the GNU General Public License as published by the Free
-# Software Foundation, either version 3 of the License, or
-# (at your option) any later version.
-#
-# groff is distributed in the hope that it will be useful, but WITHOUT ANY
-# WARRANTY; without even the implied warranty of MERCHANTABILITY or
-# FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
-# for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program. If not, see <http://www.gnu.org/licenses/>.
-#
-
-groff="${abs_top_builddir:-.}/test-groff"
-
-"$groff" -rCS=0 -Tascii -P-cbou -man <<EOF | grep -q Name
-.TH sample 1 2019-09-09 "groff test suite"
-.SH Name
-sample \- test subject for groff
-EOF
diff --git a/tmac/tests/an_CS-register-on.sh b/tmac/tests/an_CS-register-on.sh
deleted file mode 100755
index 34628a430..000000000
--- a/tmac/tests/an_CS-register-on.sh
+++ /dev/null
@@ -1,27 +0,0 @@
-#!/bin/sh
-#
-# Copyright (C) 2019-2020 Free Software Foundation, Inc.
-#
-# This file is part of groff.
-#
-# groff is free software; you can redistribute it and/or modify it under
-# the terms of the GNU General Public License as published by the Free
-# Software Foundation, either version 3 of the License, or
-# (at your option) any later version.
-#
-# groff is distributed in the hope that it will be useful, but WITHOUT ANY
-# WARRANTY; without even the implied warranty of MERCHANTABILITY or
-# FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
-# for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program. If not, see <http://www.gnu.org/licenses/>.
-#
-
-groff="${abs_top_builddir:-.}/test-groff"
-
-"$groff" -rCS=1 -Tascii -P-cbou -man <<EOF | grep -q NAME
-.TH sample 1 2019-09-09 "groff test suite"
-.SH Name
-sample \- test subject for groff
-EOF
diff --git a/tmac/tests/an_CS-register-unspecified.sh 
b/tmac/tests/an_CS-register-unspecified.sh
deleted file mode 100755
index 71b27b93b..000000000
--- a/tmac/tests/an_CS-register-unspecified.sh
+++ /dev/null
@@ -1,27 +0,0 @@
-#!/bin/sh
-#
-# Copyright (C) 2019-2020 Free Software Foundation, Inc.
-#
-# This file is part of groff.
-#
-# groff is free software; you can redistribute it and/or modify it under
-# the terms of the GNU General Public License as published by the Free
-# Software Foundation, either version 3 of the License, or
-# (at your option) any later version.
-#
-# groff is distributed in the hope that it will be useful, but WITHOUT ANY
-# WARRANTY; without even the implied warranty of MERCHANTABILITY or
-# FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
-# for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program. If not, see <http://www.gnu.org/licenses/>.
-#
-
-groff="${abs_top_builddir:-.}/test-groff"
-
-"$groff" -Tascii -P-cbou -man <<EOF | grep -q Name
-.TH sample 1 2019-09-09 "groff test suite"
-.SH Name
-sample \- test subject for groff
-EOF
diff --git a/tmac/tests/an_CS-register-works.sh 
b/tmac/tests/an_CS-register-works.sh
new file mode 100755
index 000000000..274a5eb93
--- /dev/null
+++ b/tmac/tests/an_CS-register-works.sh
@@ -0,0 +1,55 @@
+#!/bin/sh
+#
+# Copyright (C) 2019-2024 Free Software Foundation, Inc.
+#
+# This file is part of groff.
+#
+# groff is free software; you can redistribute it and/or modify it under
+# the terms of the GNU General Public License as published by the Free
+# Software Foundation, either version 3 of the License, or
+# (at your option) any later version.
+#
+# groff is distributed in the hope that it will be useful, but WITHOUT
+# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+# FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+# for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
+
+groff="${abs_top_builddir:-.}/test-groff"
+
+fail=
+
+wail() {
+    echo ...FAILED >&2
+    fail=yes
+}
+
+input='.
+.TH sample 1 2020-10-31 "groff test suite"
+.SH Name
+sample \- test subject for groff
+.'
+
+output=$(printf "%s" "$input" | "$groff" -Tascii -P -cbou -man)
+echo "$output"
+
+echo "testing package default 'CS' register setting" >&2
+echo "$output" | grep -q Name || fail
+
+output=$(printf "%s" "$input" | "$groff" -Tascii -P -cbou -rCS=0 -man)
+echo "$output"
+
+echo "testing '-rCS=0' argument " >&2
+echo "$output" | grep -q Name || fail
+
+output=$(printf "%s" "$input" | "$groff" -Tascii -P -cbou -rCS=1 -man)
+echo "$output"
+
+echo "testing '-rCS=1' argument " >&2
+echo "$output" | grep -q NAME || fail
+
+test -z "$fail"
+
+# vim:set ai et sw=4 ts=4 tw=72:
diff --git a/tmac/tests/an_CT-register-off.sh b/tmac/tests/an_CT-register-off.sh
deleted file mode 100755
index 9920543e8..000000000
--- a/tmac/tests/an_CT-register-off.sh
+++ /dev/null
@@ -1,27 +0,0 @@
-#!/bin/sh
-#
-# Copyright (C) 2019-2020 Free Software Foundation, Inc.
-#
-# This file is part of groff.
-#
-# groff is free software; you can redistribute it and/or modify it under
-# the terms of the GNU General Public License as published by the Free
-# Software Foundation, either version 3 of the License, or
-# (at your option) any later version.
-#
-# groff is distributed in the hope that it will be useful, but WITHOUT ANY
-# WARRANTY; without even the implied warranty of MERCHANTABILITY or
-# FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
-# for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program. If not, see <http://www.gnu.org/licenses/>.
-#
-
-groff="${abs_top_builddir:-.}/test-groff"
-
-"$groff" -rCT=0 -Tascii -P-cbou -man <<EOF | grep -q 'sample(1)'
-.TH sample 1 2019-09-09 "groff test suite"
-.SH Name
-sample \- test subject for groff
-EOF
diff --git a/tmac/tests/an_CT-register-on.sh b/tmac/tests/an_CT-register-on.sh
deleted file mode 100755
index 33861abc7..000000000
--- a/tmac/tests/an_CT-register-on.sh
+++ /dev/null
@@ -1,27 +0,0 @@
-#!/bin/sh
-#
-# Copyright (C) 2019-2020 Free Software Foundation, Inc.
-#
-# This file is part of groff.
-#
-# groff is free software; you can redistribute it and/or modify it under
-# the terms of the GNU General Public License as published by the Free
-# Software Foundation, either version 3 of the License, or
-# (at your option) any later version.
-#
-# groff is distributed in the hope that it will be useful, but WITHOUT ANY
-# WARRANTY; without even the implied warranty of MERCHANTABILITY or
-# FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
-# for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program. If not, see <http://www.gnu.org/licenses/>.
-#
-
-groff="${abs_top_builddir:-.}/test-groff"
-
-"$groff" -rCT=1 -Tascii -P-cbou -man <<EOF | grep -q 'SAMPLE(1)'
-.TH sample 1 2019-09-09 "groff test suite"
-.SH Name
-sample \- test subject for groff
-EOF
diff --git a/tmac/tests/an_CT-register-unspecified.sh 
b/tmac/tests/an_CT-register-unspecified.sh
deleted file mode 100755
index cc94b3f22..000000000
--- a/tmac/tests/an_CT-register-unspecified.sh
+++ /dev/null
@@ -1,27 +0,0 @@
-#!/bin/sh
-#
-# Copyright (C) 2019-2020 Free Software Foundation, Inc.
-#
-# This file is part of groff.
-#
-# groff is free software; you can redistribute it and/or modify it under
-# the terms of the GNU General Public License as published by the Free
-# Software Foundation, either version 3 of the License, or
-# (at your option) any later version.
-#
-# groff is distributed in the hope that it will be useful, but WITHOUT ANY
-# WARRANTY; without even the implied warranty of MERCHANTABILITY or
-# FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
-# for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program. If not, see <http://www.gnu.org/licenses/>.
-#
-
-groff="${abs_top_builddir:-.}/test-groff"
-
-"$groff" -Tascii -P-cbou -man <<EOF | grep -q 'sample(1)'
-.TH sample 1 2019-09-09 "groff test suite"
-.SH Name
-sample \- test subject for groff
-EOF
diff --git a/tmac/tests/an_CT-register-works.sh 
b/tmac/tests/an_CT-register-works.sh
new file mode 100755
index 000000000..886e86bb2
--- /dev/null
+++ b/tmac/tests/an_CT-register-works.sh
@@ -0,0 +1,55 @@
+#!/bin/sh
+#
+# Copyright (C) 2019-2024 Free Software Foundation, Inc.
+#
+# This file is part of groff.
+#
+# groff is free software; you can redistribute it and/or modify it under
+# the terms of the GNU General Public License as published by the Free
+# Software Foundation, either version 3 of the License, or
+# (at your option) any later version.
+#
+# groff is distributed in the hope that it will be useful, but WITHOUT
+# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+# FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+# for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
+
+groff="${abs_top_builddir:-.}/test-groff"
+
+fail=
+
+wail() {
+    echo ...FAILED >&2
+    fail=yes
+}
+
+input='.
+.TH sample 1 2020-10-31 "groff test suite"
+.SH Name
+sample \- test subject for groff
+.'
+
+output=$(printf "%s" "$input" | "$groff" -Tascii -P -cbou -man)
+echo "$output"
+
+echo "testing package default 'CT' register setting" >&2
+echo "$output" | grep -q 'sample(1).*sample(1)' || fail
+
+output=$(printf "%s" "$input" | "$groff" -Tascii -P -cbou -rCT=0 -man)
+echo "$output"
+
+echo "testing '-rCT=0' argument " >&2
+echo "$output" | grep -q 'sample(1).*sample(1)' || fail
+
+output=$(printf "%s" "$input" | "$groff" -Tascii -P -cbou -rCT=1 -man)
+echo "$output"
+
+echo "testing '-rCT=1' argument " >&2
+echo "$output" | grep -q 'SAMPLE(1).*SAMPLE(1)' || fail
+
+test -z "$fail"
+
+# vim:set ai et sw=4 ts=4 tw=72:
diff --git a/tmac/tmac.am b/tmac/tmac.am
index 8ede42142..0f393ef33 100644
--- a/tmac/tmac.am
+++ b/tmac/tmac.am
@@ -153,12 +153,8 @@ tmac_TESTS = \
   tmac/tests/an-ext_SY-and-YS-work.sh \
   tmac/tests/an-ext_UR-works.sh \
   tmac/tests/an_AT-and-UC-footer-saved-and-restored.sh \
-  tmac/tests/an_CS-register-off.sh \
-  tmac/tests/an_CS-register-on.sh \
-  tmac/tests/an_CS-register-unspecified.sh \
-  tmac/tests/an_CT-register-off.sh \
-  tmac/tests/an_CT-register-on.sh \
-  tmac/tests/an_CT-register-unspecified.sh \
+  tmac/tests/an_CS-register-works.sh \
+  tmac/tests/an_CT-register-works.sh \
   tmac/tests/an_FT-bad-value-should-not-trash-titles.sh \
   tmac/tests/an_HY-register-works.sh \
   tmac/tests/an_LL-init-sanely.sh \



reply via email to

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