summaryrefslogtreecommitdiff
path: root/regress/usr.bin
diff options
context:
space:
mode:
authorIngo Schwarze <schwarze@cvs.openbsd.org>2019-04-21 22:43:01 +0000
committerIngo Schwarze <schwarze@cvs.openbsd.org>2019-04-21 22:43:01 +0000
commit4f5bfee9461d5b9b6911f86d1ab77417eb7a6c70 (patch)
tree09eea9727827fa02bff54cc1080cc3b8ca3d72ff /regress/usr.bin
parent9947a2ff62b4914537d5e8bacc03372dbba1d937 (diff)
Implement the roff .break request (break out of a .while loop).
Jan Stary <hans at stare dot cz> found it in an ancient groffer(1) manual page (version 1.19) on MacOS X Mojave. Having .break not implemented wasn't a particularly bright idea because obviously, it tended to cause infinite loops.
Diffstat (limited to 'regress/usr.bin')
-rw-r--r--regress/usr.bin/mandoc/roff/while/Makefile4
-rw-r--r--regress/usr.bin/mandoc/roff/while/break.in16
-rw-r--r--regress/usr.bin/mandoc/roff/while/break.out_ascii9
3 files changed, 27 insertions, 2 deletions
diff --git a/regress/usr.bin/mandoc/roff/while/Makefile b/regress/usr.bin/mandoc/roff/while/Makefile
index ed970474667..42ce590a865 100644
--- a/regress/usr.bin/mandoc/roff/while/Makefile
+++ b/regress/usr.bin/mandoc/roff/while/Makefile
@@ -1,6 +1,6 @@
-# $OpenBSD: Makefile,v 1.1 2018/08/24 22:56:37 schwarze Exp $
+# $OpenBSD: Makefile,v 1.2 2019/04/21 22:43:00 schwarze Exp $
-REGRESS_TARGETS = basic badargs into nesting outof
+REGRESS_TARGETS = basic badargs break into nesting outof
LINT_TARGETS = badargs into nesting outof
# mandoc defects:
diff --git a/regress/usr.bin/mandoc/roff/while/break.in b/regress/usr.bin/mandoc/roff/while/break.in
new file mode 100644
index 00000000000..11e7d2f5e99
--- /dev/null
+++ b/regress/usr.bin/mandoc/roff/while/break.in
@@ -0,0 +1,16 @@
+.\" $OpenBSD: break.in,v 1.1 2019/04/21 22:43:00 schwarze Exp $
+.Dd $Mdocdate: April 21 2019 $
+.Dt WHILE-BREAK 1
+.Os
+.Sh NAME
+.Nm while-break
+.Nd break request inside a while loop
+.Sh DESCRIPTION
+initial text
+.nr cnt 11 1
+.while n \{\
+\n-[cnt]
+.if !\n[cnt] .break
+\(en
+.\}
+final text
diff --git a/regress/usr.bin/mandoc/roff/while/break.out_ascii b/regress/usr.bin/mandoc/roff/while/break.out_ascii
new file mode 100644
index 00000000000..8e3f39b941b
--- /dev/null
+++ b/regress/usr.bin/mandoc/roff/while/break.out_ascii
@@ -0,0 +1,9 @@
+WHILE-BREAK(1) General Commands Manual WHILE-BREAK(1)
+
+NNAAMMEE
+ wwhhiillee--bbrreeaakk - break request inside a while loop
+
+DDEESSCCRRIIPPTTIIOONN
+ initial text 10 - 9 - 8 - 7 - 6 - 5 - 4 - 3 - 2 - 1 - 0 final text
+
+OpenBSD April 21, 2019 OpenBSD