aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/regress/roff/string/undef.in
diff options
context:
space:
mode:
authorIngo Schwarze <schwarze@openbsd.org>2018-04-09 02:31:42 +0000
committerIngo Schwarze <schwarze@openbsd.org>2018-04-09 02:31:42 +0000
commit5aacba9ce0d0de6d9276777e5f2b193b60604d5f (patch)
tree3381e307653d2e733dd5fb397eb9d1f67c13244f /regress/roff/string/undef.in
parent075c90103abe758895ec66087c805141bc329824 (diff)
downloadmandoc-5aacba9ce0d0de6d9276777e5f2b193b60604d5f.tar.gz
mandoc-5aacba9ce0d0de6d9276777e5f2b193b60604d5f.tar.zst
mandoc-5aacba9ce0d0de6d9276777e5f2b193b60604d5f.zip
Using an undefined string or macro will cause it to be defined as empty.
Observed by Werner Lemberg on Nov 14, 2011 and rotting on my TODO list ever since.
Diffstat (limited to 'regress/roff/string/undef.in')
-rw-r--r--regress/roff/string/undef.in69
1 files changed, 69 insertions, 0 deletions
diff --git a/regress/roff/string/undef.in b/regress/roff/string/undef.in
new file mode 100644
index 00000000..d84a67c6
--- /dev/null
+++ b/regress/roff/string/undef.in
@@ -0,0 +1,69 @@
+.\" $OpenBSD: std.in,v 1.2 2017/07/04 14:53:27 schwarze Exp $
+.TH STRING-UNDEF 1 "April 9, 2018"
+.SH NAME
+string-undef - expanding undefined strings
+.SH DESCRIPTION
+.SS User defined string
+The sting "mys" is
+.ie dmys defined
+.el undefined
+and remains
+.ie dmys defined.
+.el undefined.
+.PP
+Its value is "\*[mys]", and now it is
+.ie dmys defined,
+.el undefined,
+and its value is still "\*[mys]".
+.PP
+.ds mys newval
+After redefining it to "\*[mys]", it is of course still
+.ie dmys defined.
+.el undefined.
+.PP
+.rm mys
+After removing the definition, it is now
+.ie dmys defined.
+.el undefined.
+.SS User defined macro
+The macro "mym" is
+.ie dmym defined.
+.el undefined.
+.PP
+It has no effect:
+.mym
+But now it is
+.ie dmym defined.
+.el undefined.
+.PP
+.de mym
+neweffect
+..
+After defining it as:
+.mym
+it is of course still
+.ie dmym defined.
+.el undefined.
+.PP
+.rm mym
+After removing the definition, it is now
+.ie dmym defined.
+.el undefined.
+.SS Renamed macro
+The standard .BR macro is
+.ie dBR defined,
+.el undefined,
+and it
+.BR works .
+.PP
+.rn BR newBR
+After renaming it, the new name is
+.ie dnewBR defined,
+.el undefined,
+and
+.newBR works .
+.SS Predefined string
+A predefined string is
+.ie dR defined
+.el undefined
+and has the value "\*R".