summaryrefslogtreecommitdiff
path: root/regress
diff options
context:
space:
mode:
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".
+
+
+