summaryrefslogtreecommitdiff
path: root/regress
diff options
context:
space:
mode:
authorIngo Schwarze <schwarze@cvs.openbsd.org>2019-01-17 06:29:15 +0000
committerIngo Schwarze <schwarze@cvs.openbsd.org>2019-01-17 06:29:15 +0000
commita3147c252e90dae5d26e9b5fe2f8d81f28e22bd2 (patch)
tree38885433fcde23c2389ce0eca3da44e87f33417e /regress
parent80b4baa67f4e4e81a8222aca1406f6d243b6c3e6 (diff)
Test handling of escaped backslashes because the code related to
copy mode is complicated and prone to regressions.
Diffstat (limited to 'regress')
-rw-r--r--regress/usr.bin/mandoc/roff/esc/Makefile4
-rw-r--r--regress/usr.bin/mandoc/roff/esc/bs_man.in27
-rw-r--r--regress/usr.bin/mandoc/roff/esc/bs_man.out_ascii21
-rw-r--r--regress/usr.bin/mandoc/roff/esc/bs_mdoc.in30
-rw-r--r--regress/usr.bin/mandoc/roff/esc/bs_mdoc.out_ascii17
5 files changed, 97 insertions, 2 deletions
diff --git a/regress/usr.bin/mandoc/roff/esc/Makefile b/regress/usr.bin/mandoc/roff/esc/Makefile
index 1be8b179a85..d691bce7838 100644
--- a/regress/usr.bin/mandoc/roff/esc/Makefile
+++ b/regress/usr.bin/mandoc/roff/esc/Makefile
@@ -1,6 +1,6 @@
-# $OpenBSD: Makefile,v 1.15 2018/12/15 23:33:20 schwarze Exp $
+# $OpenBSD: Makefile,v 1.16 2019/01/17 06:29:14 schwarze Exp $
-REGRESS_TARGETS = one two multi B c c_man e f h l O o p w z
+REGRESS_TARGETS = one two multi B bs_man bs_mdoc c c_man e f h l O o p w z
REGRESS_TARGETS += ignore invalid unsupp
HTML_TARGETS = f
LINT_TARGETS = B h l O w ignore invalid unsupp
diff --git a/regress/usr.bin/mandoc/roff/esc/bs_man.in b/regress/usr.bin/mandoc/roff/esc/bs_man.in
new file mode 100644
index 00000000000..c0469893af2
--- /dev/null
+++ b/regress/usr.bin/mandoc/roff/esc/bs_man.in
@@ -0,0 +1,27 @@
+.\" $OpenBSD: bs_man.in,v 1.1 2019/01/17 06:29:14 schwarze Exp $
+.TH ESC-BS_MAN 1 "January 17, 2019"
+.SH NAME
+esc-bs_man \- escaped backslashes in man(7) code
+.SH DESCRIPTION
+.ds usestr (initial)
+.de testmac
+prefix\*[usestr]suffix
+prefix\\*[usestr]suffix
+..
+.ds teststr prefix\*[usestr]middle\\*[usestr]suffix
+.ds usestr (later)
+on a text line: prefix\\suffix
+.PP
+in a macro definition:
+.testmac
+.PP
+in a string definition: \*[teststr]
+.PP
+in a high-level macro argument:
+.IB prefix ##\\*[usestr]## suffix
+.PP
+.de argmac
+{\\$1}
+..
+in a user-defined macro argument:
+.argmac prefix\\*[usestr]suffix
diff --git a/regress/usr.bin/mandoc/roff/esc/bs_man.out_ascii b/regress/usr.bin/mandoc/roff/esc/bs_man.out_ascii
new file mode 100644
index 00000000000..37f84001f5c
--- /dev/null
+++ b/regress/usr.bin/mandoc/roff/esc/bs_man.out_ascii
@@ -0,0 +1,21 @@
+ESC-BS_MAN(1) General Commands Manual ESC-BS_MAN(1)
+
+
+
+NNAAMMEE
+ esc-bs_man - escaped backslashes in man(7) code
+
+DDEESSCCRRIIPPTTIIOONN
+ on a text line: prefix\suffix
+
+ in a macro definition: prefix(initial)suffix prefix(later)suffix
+
+ in a string definition: prefix(initial)middle(later)suffix
+
+ in a high-level macro argument: _p_r_e_f_i_x####((llaatteerr))####_s_u_f_f_i_x
+
+ in a user-defined macro argument: {prefix(later)suffix}
+
+
+
+OpenBSD January 17, 2019 ESC-BS_MAN(1)
diff --git a/regress/usr.bin/mandoc/roff/esc/bs_mdoc.in b/regress/usr.bin/mandoc/roff/esc/bs_mdoc.in
new file mode 100644
index 00000000000..ca944676c33
--- /dev/null
+++ b/regress/usr.bin/mandoc/roff/esc/bs_mdoc.in
@@ -0,0 +1,30 @@
+.\" $OpenBSD: bs_mdoc.in,v 1.1 2019/01/17 06:29:14 schwarze Exp $
+.Dd $Mdocdate: January 17 2019 $
+.Dt ESC-BS_MDOC 1
+.Os
+.Sh NAME
+.Nm esc-bs_mdoc
+.Nd escaped backslashes in mdoc(7) code
+.Sh DESCRIPTION
+.ds usestr (initial)
+.de testmac
+prefix\*[usestr]suffix
+prefix\\*[usestr]suffix
+..
+.ds teststr prefix\*[usestr]middle\\*[usestr]suffix
+.ds usestr (later)
+on a text line: prefix\\suffix
+.Pp
+in a macro definition:
+.testmac
+.Pp
+in a string definition: \*[teststr]
+.Pp
+in a high-level macro argument:
+.Sy prefix\\*[usestr]suffix
+.Pp
+.de argmac
+{\\$1}
+..
+in a user-defined macro argument:
+.argmac prefix\\*[usestr]suffix
diff --git a/regress/usr.bin/mandoc/roff/esc/bs_mdoc.out_ascii b/regress/usr.bin/mandoc/roff/esc/bs_mdoc.out_ascii
new file mode 100644
index 00000000000..6b4e9049033
--- /dev/null
+++ b/regress/usr.bin/mandoc/roff/esc/bs_mdoc.out_ascii
@@ -0,0 +1,17 @@
+ESC-BS_MDOC(1) General Commands Manual ESC-BS_MDOC(1)
+
+NNAAMMEE
+ eesscc--bbss__mmddoocc - escaped backslashes in mdoc(7) code
+
+DDEESSCCRRIIPPTTIIOONN
+ on a text line: prefix\suffix
+
+ in a macro definition: prefix(initial)suffix prefix(later)suffix
+
+ in a string definition: prefix(initial)middle(later)suffix
+
+ in a high-level macro argument: pprreeffiixx((llaatteerr))ssuuffffiixx
+
+ in a user-defined macro argument: {prefix(later)suffix}
+
+OpenBSD January 17, 2019 OpenBSD