summaryrefslogtreecommitdiff
path: root/regress
diff options
context:
space:
mode:
authorIngo Schwarze <schwarze@cvs.openbsd.org>2022-05-01 16:19:00 +0000
committerIngo Schwarze <schwarze@cvs.openbsd.org>2022-05-01 16:19:00 +0000
commit1f0f59dabe8914907f910dbde309b3aa6cf549ac (patch)
treef3086ccaabd97032dc17574f84ab570685ea8a05 /regress
parent865bf09dda1b699fe155e6e894f92170ae744b1e (diff)
Split a new function roff_parse_comment() out of roff_expand() because this
functionality is not needed when called from roff_getarg(). This makes the long and complicated function roff_expand() significantly shorter, and also simpler in so far as it no longer needs to return ROFF_APPEND. No functional change intended.
Diffstat (limited to 'regress')
-rw-r--r--regress/usr.bin/mandoc/roff/esc/Makefile6
-rw-r--r--regress/usr.bin/mandoc/roff/esc/comment.in25
-rw-r--r--regress/usr.bin/mandoc/roff/esc/comment.out_ascii19
-rw-r--r--regress/usr.bin/mandoc/roff/esc/comment.out_lint1
4 files changed, 48 insertions, 3 deletions
diff --git a/regress/usr.bin/mandoc/roff/esc/Makefile b/regress/usr.bin/mandoc/roff/esc/Makefile
index f00aa4d3a9f..111e59bc715 100644
--- a/regress/usr.bin/mandoc/roff/esc/Makefile
+++ b/regress/usr.bin/mandoc/roff/esc/Makefile
@@ -1,10 +1,10 @@
-# $OpenBSD: Makefile,v 1.19 2022/04/27 13:30:19 schwarze Exp $
+# $OpenBSD: Makefile,v 1.20 2022/05/01 16:18:59 schwarze Exp $
-REGRESS_TARGETS = one two multi
+REGRESS_TARGETS = one two multi comment
REGRESS_TARGETS += B bs_man bs_mdoc c c_man E1 e f h hneg l O1 o p w z
REGRESS_TARGETS += ignore invalid unsupp
HTML_TARGETS = f
-LINT_TARGETS = B h l O1 w ignore invalid unsupp
+LINT_TARGETS = comment B h l O1 w ignore invalid unsupp
# mandoc defect:
# - \h with a negative argument replaces output characters
diff --git a/regress/usr.bin/mandoc/roff/esc/comment.in b/regress/usr.bin/mandoc/roff/esc/comment.in
new file mode 100644
index 00000000000..692cbf002b0
--- /dev/null
+++ b/regress/usr.bin/mandoc/roff/esc/comment.in
@@ -0,0 +1,25 @@
+.\" $OpenBSD: comment.in,v 1.1 2022/05/01 16:18:59 schwarze Exp $
+.Dd $Mdocdate: May 1 2022 $
+.Dt ROFF-ESC-COMMENT 1
+.Os
+.Sh NAME
+.Nm roff-esc-comment
+.Nd roff(7) comments
+.Sh DESCRIPTION
+text line cont\
+inuation
+.Pp
+macro line continuation:
+.Op Fl f A\
+r file
+.Pp
+whitespace \&
+at the end of an input line
+.Pp
+text line with \"not printed\
+comment
+.Pp
+continuation \#not printed
+requested by a comment
+.Pp
+Surpisingly, the sequence \\" does not start a comment.
diff --git a/regress/usr.bin/mandoc/roff/esc/comment.out_ascii b/regress/usr.bin/mandoc/roff/esc/comment.out_ascii
new file mode 100644
index 00000000000..a8698686fea
--- /dev/null
+++ b/regress/usr.bin/mandoc/roff/esc/comment.out_ascii
@@ -0,0 +1,19 @@
+ROFF-ESC-COMMENT(1) General Commands Manual ROFF-ESC-COMMENT(1)
+
+NNAAMMEE
+ rrooffff--eesscc--ccoommmmeenntt - roff(7) comments
+
+DDEESSCCRRIIPPTTIIOONN
+ text line continuation
+
+ macro line continuation: [--ff _f_i_l_e]
+
+ whitespace at the end of an input line
+
+ text line with comment
+
+ continuation requested by a comment
+
+ Surpisingly, the sequence \" does not start a comment.
+
+OpenBSD May 1, 2022 OpenBSD
diff --git a/regress/usr.bin/mandoc/roff/esc/comment.out_lint b/regress/usr.bin/mandoc/roff/esc/comment.out_lint
new file mode 100644
index 00000000000..2844ea8c6d4
--- /dev/null
+++ b/regress/usr.bin/mandoc/roff/esc/comment.out_lint
@@ -0,0 +1 @@
+mandoc: comment.in:22:29: STYLE: whitespace at end of input line