gbranden pushed a commit to branch master in repository groff. commit 8f7aba07ae7844f6667fd91475cefd45f868d725 Author: G. Branden Robinson <g.branden.robin...@gmail.com> AuthorDate: Tue Aug 5 07:17:25 2025 -0500
[mm]: Improve test scripts (1/3). * contrib/mm/tests/short-pages-do-not-overflow-stack.sh: - Add "nl -ba" to output pipeline for easy line counting by humans. - Make test stricter by expecting specific line counts instead of merely a successful exit status. - Emit the formatted document to the standard output for easy review. Also update copyright notice. I've never executed copyright assignment paperwork with the FSF, so my contribution of this script can't be under the FSF's copyright. Also drop empty comment stump at end of comment block. Also make Vim modeline more human-readable. --- contrib/mm/tests/short-pages-do-not-overflow-stack.sh | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/contrib/mm/tests/short-pages-do-not-overflow-stack.sh b/contrib/mm/tests/short-pages-do-not-overflow-stack.sh index 4be0e134e..b1d5fd3e1 100755 --- a/contrib/mm/tests/short-pages-do-not-overflow-stack.sh +++ b/contrib/mm/tests/short-pages-do-not-overflow-stack.sh @@ -1,6 +1,6 @@ #!/bin/sh # -# Copyright (C) 2022 Free Software Foundation, Inc. +# Copyright (C) 2022-2025 G. Branden Robinson # # This file is part of groff. # @@ -16,7 +16,6 @@ # # 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" @@ -42,11 +41,15 @@ Main matter goes here.' echo "checking that sample document fits using default length" >&2 output=$(printf "%s\n" "$input" \ - | "$groff" -b -mm -Tascii -P-cbou) || wail + | "$groff" -b -mm -Tascii -P-cbou | nl -ba) +echo "$output" +test "$(echo "$output" | wc -l)" -eq 132 || wail # 66 lines * 2 pages echo "checking that sample document fits using -rL5v" >&2 output=$(printf "%s\n" "$input" \ - | "$groff" -b -rL5v -mm -Tascii -P-cbou) || wail + | "$groff" -b -rL5v -mm -Tascii -P-cbou | nl -ba) +echo "$output" +test "$(echo "$output" | wc -l)" -eq 40 || wail # 5 lines * 8 pages echo "checking that sample document fails gracefully using -rL4v" >&2 error=$(printf "%s\n" "$input" \ @@ -56,4 +59,4 @@ test $(echo "$error" | wc -l) -lt 10 || wail test -z "$fail" -# vim:set ai et sw=4 ts=4 tw=72: +# vim:set autoindent expandtab shiftwidth=4 tabstop=4 textwidth=72: _______________________________________________ groff-commit mailing list groff-commit@gnu.org https://lists.gnu.org/mailman/listinfo/groff-commit