gbranden pushed a commit to branch master in repository groff. commit 3c7c02e20006011b838d49930998bbf0ad324912 Author: G. Branden Robinson <g.branden.robin...@gmail.com> AuthorDate: Sat Aug 26 11:18:22 2023 -0500
[eqn]: Implement "reset" primitive/command (3/3). * src/preproc/eqn/tests/parameters-can-be-set-and-reset.sh: Test it. * src/preproc/eqn/eqn.am (eqn_TESTS): Run test. --- ChangeLog | 4 ++ src/preproc/eqn/eqn.am | 3 +- .../eqn/tests/parameters-can-be-set-and-reset.sh | 55 ++++++++++++++++++++++ 3 files changed, 61 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index 806eab292..219576085 100644 --- a/ChangeLog +++ b/ChangeLog @@ -57,6 +57,10 @@ * src/preproc/eqn/eqn.1.man (Customization): Document it. + * src/preproc/eqn/tests/parameters-can-be-set-and-reset.sh: Test + it. + * src/preproc/eqn/eqn.am (eqn_TESTS): Run test. + * NEWS: Add item. Fixes <https://savannah.gnu.org/bugs/?62692>. diff --git a/src/preproc/eqn/eqn.am b/src/preproc/eqn/eqn.am index e32bfb5b0..b0ff41036 100644 --- a/src/preproc/eqn/eqn.am +++ b/src/preproc/eqn/eqn.am @@ -67,7 +67,8 @@ neqn: $(top_srcdir)/src/preproc/eqn/neqn.sh $(SH_DEPS_SED_SCRIPT) && mv $@.tmp $@ eqn_TESTS = \ - src/preproc/eqn/tests/diagnostics-report-correct-line-numbers.sh + src/preproc/eqn/tests/diagnostics-report-correct-line-numbers.sh \ + src/preproc/eqn/tests/parameters-can-be-set-and-reset.sh TESTS += $(eqn_TESTS) EXTRA_DIST += $(eqn_TESTS) diff --git a/src/preproc/eqn/tests/parameters-can-be-set-and-reset.sh b/src/preproc/eqn/tests/parameters-can-be-set-and-reset.sh new file mode 100755 index 000000000..668272c56 --- /dev/null +++ b/src/preproc/eqn/tests/parameters-can-be-set-and-reset.sh @@ -0,0 +1,55 @@ +#!/bin/sh +# +# Copyright (C) 2023 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 + echo "$error" + fail=yes +} + +input='.EQ +a b + c +.EN +.br +.EQ +set medium_space 100 +d e + f +.EN +.br +.EQ +reset medium_space +g h + i +.EN' + +output=$(printf "%s\n" "$input" | "$groff" -e -T ascii -P -cbou) +echo "$output" + +echo "checking that 'medium_space' is alterable" >&2 +echo "$output" | grep -Fqx 'de + f' || wail + +echo "checking that 'medium_space' can be reset to default" >&2 +echo "$output" | grep -Fqx 'gh+i' || wail + +test -z "$fail" + +# vim:set ai et sw=4 ts=4 tw=72: _______________________________________________ Groff-commit mailing list Groff-commit@gnu.org https://lists.gnu.org/mailman/listinfo/groff-commit