diff options
author | Colin Watson <cjwatson@debian.org> | 2018-11-09 21:06:26 +0000 |
---|---|---|
committer | Colin Watson <cjwatson@debian.org> | 2018-11-09 21:37:15 +0000 |
commit | 95023279b69986a9c1fee841b2c626ae3973205c (patch) | |
tree | 7da4ec4be3811731639a495339139ec3a19bd568 /src/tests | |
parent | 6a62835c9c3987b3154f49808228475042f4af45 (diff) |
lexgrog: Fix handling of \- in RHS of NAME section
Fixes Debian bug #913351.
* src/lexgrog.l (MAN_NAME): Split into MAN_NAME (left-hand side) and
MAN_DESC (right-hand side). Most rules remain as before, except that \-
and similar are only handled specially in MAN_NAME and transition to
MAN_DESC, and rules that add a 0x11 marker (indicating the start of a
new whatis definition) transition to MAN_NAME.
(MAN_NAME_AT, MAN_NAME_BSX, MAN_NAME_BX, MAN_NAME_BX_RELEASE,
MAN_NAME_DQ, MAN_NAME_FX, MAN_NAME_NX, MAN_NAME_OX): Rename to
MAN_DESC_*.
(mdoc_text): Transition to MAN_DESC rather than MAN_NAME.
(newline_found): If adding 0x11, transition to MAN_NAME.
* src/tests/lexgrog-3: New file.
* src/tests/Makefile.am (ALL_TESTS): Add lexgrog-3.
* NEWS: Document this.
Diffstat (limited to 'src/tests')
-rw-r--r-- | src/tests/Makefile.am | 2 | ||||
-rw-r--r-- | src/tests/lexgrog-3 | 20 |
2 files changed, 21 insertions, 1 deletions
diff --git a/src/tests/Makefile.am b/src/tests/Makefile.am index b3e834cc..3d11394e 100644 --- a/src/tests/Makefile.am +++ b/src/tests/Makefile.am @@ -26,7 +26,7 @@ TESTS_ENVIRONMENT = PATH=$(abs_builddir)/..:$$PATH; export PATH; \ # Each test must use the configure-detected shell, not necessarily /bin/sh. AM_LOG_FLAGS = $(SHELL) ALL_TESTS = \ - lexgrog-1 lexgrog-2 \ + lexgrog-1 lexgrog-2 lexgrog-3 \ man-1 man-2 man-3 man-4 man-5 man-6 man-7 man-8 man-9 man-10 man-11 \ manconv-1 manconv-2 manconv-3 \ mandb-1 mandb-2 mandb-3 mandb-4 mandb-5 mandb-6 mandb-7 \ diff --git a/src/tests/lexgrog-3 b/src/tests/lexgrog-3 new file mode 100644 index 00000000..a6a66a91 --- /dev/null +++ b/src/tests/lexgrog-3 @@ -0,0 +1,20 @@ +#! /bin/sh + +# Test handling of \- in the right-hand side of a NAME section. + +: ${srcdir=.} +. "$srcdir/testlib.sh" + +: ${LEXGROG=lexgrog} + +init + +write_page lextest 1 "$tmpdir/usr/share/man/man1/lextest.1.gz" UTF-8 gz '' \ + 'lextest \- see lextest \-\-help' +cat >"$tmpdir/3.exp" <<EOF +$tmpdir/usr/share/man/man1/lextest.1.gz: "lextest - see lextest --help" +EOF +run $LEXGROG "$tmpdir/usr/share/man/man1/lextest.1.gz" >"$tmpdir/3.out" +expect_pass 'multiple whatis definitions' 'diff -u "$tmpdir/3.exp" "$tmpdir/3.out"' + +finish |