diff options
Diffstat (limited to 'regress/roff/string')
-rw-r--r-- | regress/roff/string/Makefile | 11 | ||||
-rw-r--r-- | regress/roff/string/escape.in | 26 | ||||
-rw-r--r-- | regress/roff/string/escape.out_ascii | 31 | ||||
-rw-r--r-- | regress/roff/string/infinite.in | 8 | ||||
-rw-r--r-- | regress/roff/string/infinite.out_ascii | 13 | ||||
-rw-r--r-- | regress/roff/string/name.in | 35 | ||||
-rw-r--r-- | regress/roff/string/name.out_ascii | 18 | ||||
-rw-r--r-- | regress/roff/string/name.out_lint | 17 | ||||
-rw-r--r-- | regress/roff/string/zerolength.in | 16 | ||||
-rw-r--r-- | regress/roff/string/zerolength.out_ascii | 15 |
10 files changed, 190 insertions, 0 deletions
diff --git a/regress/roff/string/Makefile b/regress/roff/string/Makefile new file mode 100644 index 00000000..d2cd125b --- /dev/null +++ b/regress/roff/string/Makefile @@ -0,0 +1,11 @@ +# $OpenBSD: Makefile,v 1.6 2014/07/06 19:08:57 schwarze Exp $ + +REGRESS_TARGETS=escape infinite zerolength name +LINT_TARGETS = name + +# The infinite test fails badly with groff-1.20.1: +# It fails to print the following text. + +SKIP_GROFF ?= infinite + +.include <bsd.regress.mk> diff --git a/regress/roff/string/escape.in b/regress/roff/string/escape.in new file mode 100644 index 00000000..05a271e8 --- /dev/null +++ b/regress/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/roff/string/escape.out_ascii b/regress/roff/string/escape.out_ascii new file mode 100644 index 00000000..fc8021aa --- /dev/null +++ b/regress/roff/string/escape.out_ascii @@ -0,0 +1,31 @@ +STRING-ESCAPE(1) General Commands Manual 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". + + + + December 3, 2010 STRING-ESCAPE(1) diff --git a/regress/roff/string/infinite.in b/regress/roff/string/infinite.in new file mode 100644 index 00000000..e16c527d --- /dev/null +++ b/regress/roff/string/infinite.in @@ -0,0 +1,8 @@ +.TH STRING-INFINITE 1 "December 3, 2010" OpenBSD +.SH NAME +string-infinite - endless recursion in string expansion +.SH DESCRIPTION +.ds recur \\*[recur] +Blow up, +(and do not \*[recur] print this) +but still render following text correctly. diff --git a/regress/roff/string/infinite.out_ascii b/regress/roff/string/infinite.out_ascii new file mode 100644 index 00000000..1a9a5d6a --- /dev/null +++ b/regress/roff/string/infinite.out_ascii @@ -0,0 +1,13 @@ +STRING-INFINITE(1) General Commands Manual STRING-INFINITE(1) + + + +NNAAMMEE + string-infinite - endless recursion in string expansion + +DDEESSCCRRIIPPTTIIOONN + Blow up, but still render following text correctly. + + + +OpenBSD December 3, 2010 STRING-INFINITE(1) diff --git a/regress/roff/string/name.in b/regress/roff/string/name.in new file mode 100644 index 00000000..a2a524a4 --- /dev/null +++ b/regress/roff/string/name.in @@ -0,0 +1,35 @@ +.Dd January 10, 2011 +.Dt STRING-NAME 1 +.Os OpenBSD +.Sh NAME +.Nm string-name +.Nd torturing .ds with weird string names +.Sh DESCRIPTION +.ds norm value of norm +.ds "quot" value of "quot" +.ds bs\e value of bs\ee +.ds bs\\e value of bs\e\ee +.ds bl\ e value of bl\e e +norm: \*[norm] +.br +norm without closing brace: \*[norm +.br +quot: \*[quot] +.br +"quot": \*["quot"] +.br +bs\e\ee: \*[bs\\e] +.\".br +.\"bs\ee: \*[bs\e] +.br +bse: \*[bse] +.br +bs: \*[bs] +.\".br +.\"bl\e e: \*[bl\ e] +.br +bl e: \*[bl e] +.br +ble: \*[ble] +.br +bl: \*[bl] diff --git a/regress/roff/string/name.out_ascii b/regress/roff/string/name.out_ascii new file mode 100644 index 00000000..45ebba19 --- /dev/null +++ b/regress/roff/string/name.out_ascii @@ -0,0 +1,18 @@ +STRING-NAME(1) General Commands Manual STRING-NAME(1) + +NNAAMMEE + ssttrriinngg--nnaammee - torturing .ds with weird string names + +DDEESSCCRRIIPPTTIIOONN + norm: value of norm + norm without closing brace: + quot: + "quot": value of "quot" + bs\\e: value of bs\\e + bse: + bs: + bl e: + ble: + bl: + +OpenBSD January 10, 2011 OpenBSD diff --git a/regress/roff/string/name.out_lint b/regress/roff/string/name.out_lint new file mode 100644 index 00000000..c4c757f5 --- /dev/null +++ b/regress/roff/string/name.out_lint @@ -0,0 +1,17 @@ +mandoc: name.in:10:5: ERROR: escaped character not allowed in a name: bs\e +mandoc: name.in:12:5: ERROR: escaped character not allowed in a name: bl\ +mandoc: name.in:15:29: WARNING: invalid escape sequence: \*[norm +mandoc: name.in:15:29: WARNING: undefined string, using "": norm +mandoc: name.in:15:28: WARNING: whitespace at end of input line +mandoc: name.in:17:7: WARNING: undefined string, using "": quot +mandoc: name.in:17:6: WARNING: whitespace at end of input line +mandoc: name.in:25:6: WARNING: undefined string, using "": bse +mandoc: name.in:25:5: WARNING: whitespace at end of input line +mandoc: name.in:27:5: WARNING: undefined string, using "": bs +mandoc: name.in:27:4: WARNING: whitespace at end of input line +mandoc: name.in:31:7: WARNING: undefined string, using "": bl e +mandoc: name.in:31:6: WARNING: whitespace at end of input line +mandoc: name.in:33:6: WARNING: undefined string, using "": ble +mandoc: name.in:33:5: WARNING: whitespace at end of input line +mandoc: name.in:35:5: WARNING: undefined string, using "": bl +mandoc: name.in:35:4: WARNING: whitespace at end of input line diff --git a/regress/roff/string/zerolength.in b/regress/roff/string/zerolength.in new file mode 100644 index 00000000..0d4d9bac --- /dev/null +++ b/regress/roff/string/zerolength.in @@ -0,0 +1,16 @@ +.TH STRING-ZEROLENGTH 1 "December 19, 2010" +.SH NAME +string-zerolength - handling of zero-length user-defined strings +.SH DESCRIPTION +.ds dszero " +.de dezero +.. +use zero-length string: +x\*[dszero]x +.dszero +x +.PP +use zero-length macro: +x\*[dezero]x +.dezero +x diff --git a/regress/roff/string/zerolength.out_ascii b/regress/roff/string/zerolength.out_ascii new file mode 100644 index 00000000..ff9d2473 --- /dev/null +++ b/regress/roff/string/zerolength.out_ascii @@ -0,0 +1,15 @@ +STRING-ZEROLENGTH(1) General Commands Manual STRING-ZEROLENGTH(1) + + + +NNAAMMEE + string-zerolength - handling of zero-length user-defined strings + +DDEESSCCRRIIPPTTIIOONN + use zero-length string: xx x + + use zero-length macro: xx x + + + + December 19, 2010 STRING-ZEROLENGTH(1) |