summaryrefslogtreecommitdiff
path: root/regress/usr.bin
diff options
context:
space:
mode:
authorIngo Schwarze <schwarze@cvs.openbsd.org>2014-07-05 01:11:34 +0000
committerIngo Schwarze <schwarze@cvs.openbsd.org>2014-07-05 01:11:34 +0000
commit1e7c3f59836fc395283cd75fcf7a9229c2157602 (patch)
treeabead363fb129d7fc9488b1baa60c33c5422245e /regress/usr.bin
parent6097cb332d18be0b620a77386e97d76c8c3aeeed (diff)
Cleanup regarding -offset and -width:
* Bugfix: Last one wins, not first one. * Fix .Bl -width without argument: it means 0n, so do not ignore it. * Report macro names, argument names and fallbacks in related messages. * Simplify: Garbage collect auxiliary variables in pre_bd() and pre_bl().
Diffstat (limited to 'regress/usr.bin')
-rw-r--r--regress/usr.bin/mandoc/mdoc/Bd/Makefile6
-rw-r--r--regress/usr.bin/mandoc/mdoc/Bd/badargs.in17
-rw-r--r--regress/usr.bin/mandoc/mdoc/Bd/badargs.out_ascii13
-rw-r--r--regress/usr.bin/mandoc/mdoc/Bd/badargs.out_lint4
-rw-r--r--regress/usr.bin/mandoc/mdoc/Bl/Makefile10
-rw-r--r--regress/usr.bin/mandoc/mdoc/Bl/badargs.in44
-rw-r--r--regress/usr.bin/mandoc/mdoc/Bl/badargs.out_ascii26
-rw-r--r--regress/usr.bin/mandoc/mdoc/Bl/badargs.out_lint10
8 files changed, 123 insertions, 7 deletions
diff --git a/regress/usr.bin/mandoc/mdoc/Bd/Makefile b/regress/usr.bin/mandoc/mdoc/Bd/Makefile
index 1231c86730b..f13a8ad186c 100644
--- a/regress/usr.bin/mandoc/mdoc/Bd/Makefile
+++ b/regress/usr.bin/mandoc/mdoc/Bd/Makefile
@@ -1,10 +1,10 @@
-# $OpenBSD: Makefile,v 1.11 2014/07/04 01:50:03 schwarze Exp $
+# $OpenBSD: Makefile,v 1.12 2014/07/05 01:11:33 schwarze Exp $
REGRESS_TARGETS = blank nested spacing
-REGRESS_TARGETS += notype empty offset-empty
+REGRESS_TARGETS += notype badargs empty offset-empty
REGRESS_TARGETS += break broken
-LINT_TARGETS = nested notype break broken
+LINT_TARGETS = nested notype badargs break broken
# groff defect:
# - a display breaking another block continues indefinitely
diff --git a/regress/usr.bin/mandoc/mdoc/Bd/badargs.in b/regress/usr.bin/mandoc/mdoc/Bd/badargs.in
new file mode 100644
index 00000000000..5177d9c6e13
--- /dev/null
+++ b/regress/usr.bin/mandoc/mdoc/Bd/badargs.in
@@ -0,0 +1,17 @@
+.Dd July 4, 2014
+.Dt BD-BADARGS 1
+.Os OpenBSD
+.Sh NAME
+.Nm Bd-badargs
+.Nd display block with bad arguments
+.Sh DESCRIPTION
+trailing -offset:
+.Bd -ragged -offset
+is
+ignored
+.Ed tail argument
+double -compact and -offset
+.Bd -ragged -compact -offset 42n -compact -offset 6n
+last
+wins
+.Ed
diff --git a/regress/usr.bin/mandoc/mdoc/Bd/badargs.out_ascii b/regress/usr.bin/mandoc/mdoc/Bd/badargs.out_ascii
new file mode 100644
index 00000000000..c0ecc18ca48
--- /dev/null
+++ b/regress/usr.bin/mandoc/mdoc/Bd/badargs.out_ascii
@@ -0,0 +1,13 @@
+BD-BADARGS(1) OpenBSD Reference Manual BD-BADARGS(1)
+
+NNAAMMEE
+ BBdd--bbaaddaarrggss - display block with bad arguments
+
+DDEESSCCRRIIPPTTIIOONN
+ trailing -offset:
+
+ is ignored
+ double -compact and -offset
+ last wins
+
+OpenBSD July 4, 2014 OpenBSD
diff --git a/regress/usr.bin/mandoc/mdoc/Bd/badargs.out_lint b/regress/usr.bin/mandoc/mdoc/Bd/badargs.out_lint
new file mode 100644
index 00000000000..83076847fba
--- /dev/null
+++ b/regress/usr.bin/mandoc/mdoc/Bd/badargs.out_lint
@@ -0,0 +1,4 @@
+mandoc: badargs.in:9:20: WARNING: skipping empty argument: Bd -offset
+mandoc: badargs.in:12:2: ERROR: skipping all arguments: Ed tail argument
+mandoc: badargs.in:14:43: WARNING: duplicate argument: Bd -compact
+mandoc: badargs.in:14:51: WARNING: duplicate argument: Bd -offset 6n
diff --git a/regress/usr.bin/mandoc/mdoc/Bl/Makefile b/regress/usr.bin/mandoc/mdoc/Bl/Makefile
index bb848afc905..6c18108a512 100644
--- a/regress/usr.bin/mandoc/mdoc/Bl/Makefile
+++ b/regress/usr.bin/mandoc/mdoc/Bl/Makefile
@@ -1,13 +1,15 @@
-# $OpenBSD: Makefile,v 1.21 2014/07/04 01:50:03 schwarze Exp $
+# $OpenBSD: Makefile,v 1.22 2014/07/05 01:11:33 schwarze Exp $
REGRESS_TARGETS = item inset diag ohang bullet dash enum hang tag
REGRESS_TARGETS += column extend nested
-REGRESS_TARGETS += notype multitype multitag
-REGRESS_TARGETS += empty noIt emptyhead emptytag emptyitem
+REGRESS_TARGETS += notype multitype badargs
+REGRESS_TARGETS += empty noIt emptyhead emptytag emptyitem multitag
REGRESS_TARGETS += bareTa unclosed break broken
-LINT_TARGETS = notype noIt emptyhead emptytag emptyitem break broken
+LINT_TARGETS = notype badargs
+LINT_TARGETS += noIt emptyhead emptytag emptyitem
+LINT_TARGETS += break broken
# groff-1.22.2 defects:
# - lists with missing or late type ruin indentation
diff --git a/regress/usr.bin/mandoc/mdoc/Bl/badargs.in b/regress/usr.bin/mandoc/mdoc/Bl/badargs.in
new file mode 100644
index 00000000000..7424610b9fb
--- /dev/null
+++ b/regress/usr.bin/mandoc/mdoc/Bl/badargs.in
@@ -0,0 +1,44 @@
+.Dd July 4, 2014
+.Dt BL-BADARGS 1
+.Os OpenBSD
+.Sh NAME
+.Nm Bl-badargs
+.Nd list with bad arguments
+.Sh DESCRIPTION
+trailing -offset:
+.Bl -bullet -offset
+.It
+is ignored
+.El
+trailing -width:
+.Bl -bullet -width
+.It
+bullet
+.El
+.Bl -dash -width
+.It
+dash
+.El
+.\" XXX Doesn't work with -Tman yet.
+.\" .Bl -enum -width
+.\" .It
+.\" enum
+.\" .El
+.Bl -hyphen -width
+.It
+hyphen
+.El
+.Bl -hang -width
+.It hang
+item
+.El
+.Bl -tag -width
+.It tag
+Here we need a very long line.
+It must be sufficiently long such that it wraps the line.
+.El
+double arguments:
+.Bl -tag -compact -offset 20n -width 20n -compact -offset 2n -width 6n
+.It last
+wins
+.El tail argument
diff --git a/regress/usr.bin/mandoc/mdoc/Bl/badargs.out_ascii b/regress/usr.bin/mandoc/mdoc/Bl/badargs.out_ascii
new file mode 100644
index 00000000000..f865b9680a5
--- /dev/null
+++ b/regress/usr.bin/mandoc/mdoc/Bl/badargs.out_ascii
@@ -0,0 +1,26 @@
+BL-BADARGS(1) OpenBSD Reference Manual BL-BADARGS(1)
+
+NNAAMMEE
+ BBll--bbaaddaarrggss - list with bad arguments
+
+DDEESSCCRRIIPPTTIIOONN
+ trailing -offset:
+
+ oo is ignored
+ trailing -width:
+
+ oo bullet
+
+ -- dash
+
+ -- hyphen
+
+ hang item
+
+ tag
+ Here we need a very long line. It must be sufficiently long such that
+ it wraps the line.
+ double arguments:
+ last wins
+
+OpenBSD July 4, 2014 OpenBSD
diff --git a/regress/usr.bin/mandoc/mdoc/Bl/badargs.out_lint b/regress/usr.bin/mandoc/mdoc/Bl/badargs.out_lint
new file mode 100644
index 00000000000..dc119687440
--- /dev/null
+++ b/regress/usr.bin/mandoc/mdoc/Bl/badargs.out_lint
@@ -0,0 +1,10 @@
+mandoc: badargs.in:9:20: WARNING: empty argument, using 0n: Bl -offset
+mandoc: badargs.in:14:19: WARNING: empty argument, using 0n: Bl -width
+mandoc: badargs.in:18:17: WARNING: empty argument, using 0n: Bl -width
+mandoc: badargs.in:27:19: WARNING: empty argument, using 0n: Bl -width
+mandoc: badargs.in:31:17: WARNING: empty argument, using 0n: Bl -width
+mandoc: badargs.in:35:16: WARNING: empty argument, using 0n: Bl -width
+mandoc: badargs.in:41:51: WARNING: duplicate argument: Bl -compact
+mandoc: badargs.in:41:59: WARNING: duplicate argument: Bl -offset 2n
+mandoc: badargs.in:41:69: WARNING: duplicate argument: Bl -width 6n
+mandoc: badargs.in:44:2: ERROR: skipping all arguments: El tail argument