aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/regress/roff/esc/bs_mdoc.in
diff options
context:
space:
mode:
authorIngo Schwarze <schwarze@openbsd.org>2019-01-17 06:33:35 +0000
committerIngo Schwarze <schwarze@openbsd.org>2019-01-17 06:33:35 +0000
commita4ae71bcffff865ae59067bce50ebae4d526f916 (patch)
treeaef6ece2c5f041b726cabf2498968cf1c5ce7af2 /regress/roff/esc/bs_mdoc.in
parent9e2b86ff9d14ef40a2d3e80e6164eaa343e4face (diff)
downloadmandoc-a4ae71bcffff865ae59067bce50ebae4d526f916.tar.gz
mandoc-a4ae71bcffff865ae59067bce50ebae4d526f916.tar.zst
mandoc-a4ae71bcffff865ae59067bce50ebae4d526f916.zip
Test handling of escaped backslashes because the code related to
copy mode is complicated and prone to regressions.
Diffstat (limited to 'regress/roff/esc/bs_mdoc.in')
-rw-r--r--regress/roff/esc/bs_mdoc.in30
1 files changed, 30 insertions, 0 deletions
diff --git a/regress/roff/esc/bs_mdoc.in b/regress/roff/esc/bs_mdoc.in
new file mode 100644
index 00000000..ca944676
--- /dev/null
+++ b/regress/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