summaryrefslogtreecommitdiff
path: root/regress
diff options
context:
space:
mode:
authorIngo Schwarze <schwarze@cvs.openbsd.org>2010-12-09 20:56:31 +0000
committerIngo Schwarze <schwarze@cvs.openbsd.org>2010-12-09 20:56:31 +0000
commitcd3d4c2d437236c950f9786be9ad635ff386d44e (patch)
tree0440829851b2ad3436c10dc1b640d9c19b227c38 /regress
parentcffe1766d285fe42c06fcda8903fd8c9ac4f2be4 (diff)
Roff only interpolates \* strings when the leading backslash is not escaped.
Kristaps@ agrees with the idea, even though he didn't review the final patch.
Diffstat (limited to 'regress')
-rw-r--r--regress/usr.bin/mandoc/roff/Makefile4
-rw-r--r--regress/usr.bin/mandoc/roff/string/Makefile5
-rw-r--r--regress/usr.bin/mandoc/roff/string/escape.in26
-rw-r--r--regress/usr.bin/mandoc/roff/string/escape.out_ascii30
4 files changed, 63 insertions, 2 deletions
diff --git a/regress/usr.bin/mandoc/roff/Makefile b/regress/usr.bin/mandoc/roff/Makefile
index f332351a5af..33c2617c79e 100644
--- a/regress/usr.bin/mandoc/roff/Makefile
+++ b/regress/usr.bin/mandoc/roff/Makefile
@@ -1,6 +1,6 @@
-# $OpenBSD: Makefile,v 1.1 2010/04/25 17:35:31 schwarze Exp $
+# $OpenBSD: Makefile,v 1.2 2010/12/09 20:56:30 schwarze Exp $
-SUBDIR+= cond
+SUBDIR+= cond string
groff groff-clean: _SUBDIRUSE
diff --git a/regress/usr.bin/mandoc/roff/string/Makefile b/regress/usr.bin/mandoc/roff/string/Makefile
new file mode 100644
index 00000000000..38c6c1f5afc
--- /dev/null
+++ b/regress/usr.bin/mandoc/roff/string/Makefile
@@ -0,0 +1,5 @@
+# $OpenBSD: Makefile,v 1.1 2010/12/09 20:56:30 schwarze Exp $
+
+REGRESS_TARGETS=escape
+
+.include <bsd.regress.mk>
diff --git a/regress/usr.bin/mandoc/roff/string/escape.in b/regress/usr.bin/mandoc/roff/string/escape.in
new file mode 100644
index 00000000000..05a271e8e2d
--- /dev/null
+++ b/regress/usr.bin/mandoc/roff/string/escape.in
@@ -0,0 +1,26 @@
+.TH STRING-ESCAPE 1 "December 3, 2010"
+.SH NAME
+string-escape - preventing string interpolation
+.SH DESCRIPTION
+.ds right wrong
+.ds inner *[right]
+.ds outer \\*[inner]
+.SS Normal interpolation
+result: \*[inner]
+.PP
+The above line must be "result: *[right]".
+.SS Intervening character
+result: \e*[right]
+.PP
+The above line must be "result: backslash*[right]",
+not "result: rong".
+.SS Escaped backslash
+result: \\*[right]
+.PP
+The above line must be "result: backslash*[right]",
+not "result: rong".
+.SS Delayed interpolation
+result: \*[outer]
+.PP
+The above line must be "result: *[right]",
+not "result: wrong".
diff --git a/regress/usr.bin/mandoc/roff/string/escape.out_ascii b/regress/usr.bin/mandoc/roff/string/escape.out_ascii
new file mode 100644
index 00000000000..a4e9d50aa0b
--- /dev/null
+++ b/regress/usr.bin/mandoc/roff/string/escape.out_ascii
@@ -0,0 +1,30 @@
+STRING-ESCAPE(1) STRING-ESCAPE(1)
+
+
+
+NNAAMMEE
+ string-escape - preventing string interpolation
+
+DDEESSCCRRIIPPTTIIOONN
+ NNoorrmmaall iinntteerrppoollaattiioonn
+ result: *[right]
+
+ The above line must be "result: *[right]".
+
+ IInntteerrvveenniinngg cchhaarraacctteerr
+ result: \*[right]
+
+ The above line must be "result: backslash*[right]", not "result: rong".
+
+ EEssccaappeedd bbaacckkssllaasshh
+ result: \*[right]
+
+ The above line must be "result: backslash*[right]", not "result: rong".
+
+ DDeellaayyeedd iinntteerrppoollaattiioonn
+ result: *[right]
+
+ The above line must be "result: *[right]", not "result: wrong".
+
+
+