[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[groff] 07/23: [troff]: Add regression test for Savannah #63011.
From: |
G. Branden Robinson |
Subject: |
[groff] 07/23: [troff]: Add regression test for Savannah #63011. |
Date: |
Fri, 16 Sep 2022 13:07:40 -0400 (EDT) |
gbranden pushed a commit to branch master
in repository groff.
commit 945e98944e571097895ae1a1bcc23db20e04681c
Author: G. Branden Robinson <g.branden.robinson@gmail.com>
AuthorDate: Tue Sep 13 06:51:08 2022 -0500
[troff]: Add regression test for Savannah #63011.
* src/roff/groff/tests/some_escapes_accept_newline_delimiters.sh: Do it.
* src/roff/groff/groff.am (groff_TESTS): Run it.
Test fails at this commit (all cases except '\X').
---
ChangeLog | 8 +++
src/roff/groff/groff.am | 1 +
.../some_escapes_accept_newline_delimiters.sh | 76 ++++++++++++++++++++++
3 files changed, 85 insertions(+)
diff --git a/ChangeLog b/ChangeLog
index 114ffe274..aba1c6863 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,11 @@
+2022-09-13 G. Branden Robinson <g.branden.robinson@gmail.com>
+
+ [troff]: Add regression test for Savannah #63011.
+
+ * src/roff/groff/tests/\
+ some_escapes_accept_newline_delimiters.sh: Do it.
+ * src/roff/groff/groff.am (groff_TESTS): Run it.
+
2022-09-13 G. Branden Robinson <g.branden.robinson@gmail.com>
* src/roff/troff/input.cpp (do_special): Fix code style nit;
diff --git a/src/roff/groff/groff.am b/src/roff/groff/groff.am
index 3d472683d..874400887 100644
--- a/src/roff/groff/groff.am
+++ b/src/roff/groff/groff.am
@@ -59,6 +59,7 @@ groff_TESTS = \
src/roff/groff/tests/regression_savannah_58337.sh \
src/roff/groff/tests/regression_savannah_59202.sh \
src/roff/groff/tests/smoke-test_html_device.sh \
+ src/roff/groff/tests/some_escapes_accept_newline_delimiters.sh \
src/roff/groff/tests/soquiet_works.sh \
src/roff/groff/tests/string_case_xform_errors.sh \
src/roff/groff/tests/string_case_xform_requests.sh \
diff --git a/src/roff/groff/tests/some_escapes_accept_newline_delimiters.sh
b/src/roff/groff/tests/some_escapes_accept_newline_delimiters.sh
new file mode 100755
index 000000000..c888b1e86
--- /dev/null
+++ b/src/roff/groff/tests/some_escapes_accept_newline_delimiters.sh
@@ -0,0 +1,76 @@
+#!/bin/sh
+#
+# Copyright (C) 2022 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
+}
+
+# Regression-test Savannah #63011.
+#
+# A handful of escape sequences bizarrely accept newlines as argument
+# delimiters. Don't throw diagnostics if they are used.
+
+input=".sp
+\b
++|+
+That's my bracket.
+.pl \n(nlu"
+
+echo "checking that newline is accepted as delimeter to 'b' escape" >&2
+output=$(printf "%s\n" "$input" | "$groff" -Tascii -ww -z 2>&1)
+test -z "$output" || wail
+
+input="caf\o
+e\(aa
+in Paris
+.pl \n(nlu"
+
+echo "checking that newline is accepted as delimeter to 'o' escape" >&2
+output=$(printf "%s\n" "$input" | "$groff" -Tascii -ww -z 2>&1)
+test -z "$output" || wail
+
+input="The word _girth_ has a width of
+.nr w \w
+girth
+\nw units.
+.pl \n(nlu"
+
+echo "checking that newline is accepted as delimeter to 'w' escape" >&2
+output=$(printf "%s\n" "$input" | "$groff" -Tascii -ww -z 2>&1)
+test -z "$output" || wail
+
+input="I am issuing a device control command
+\X
+tty: bogus
+now.
+.pl \n(nlu"
+
+echo "checking that newline is accepted as delimeter to 'X' escape" >&2
+output=$(printf "%s\n" "$input" | "$groff" -Tascii -ww -z 2>&1)
+test -z "$output" || wail
+
+test -z "$fail"
+
+# vim:set autoindent expandtab shiftwidth=2 tabstop=2 textwidth=72:
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [groff] 07/23: [troff]: Add regression test for Savannah #63011.,
G. Branden Robinson <=