summaryrefslogtreecommitdiff
path: root/regress
diff options
context:
space:
mode:
authorIngo Schwarze <schwarze@cvs.openbsd.org>2015-01-26 00:54:10 +0000
committerIngo Schwarze <schwarze@cvs.openbsd.org>2015-01-26 00:54:10 +0000
commitc93c28ddbd10b595b059b57e708baf92fe431c33 (patch)
tree9dfb9acc1679ed7fe7a6719a72d2c384083c9331 /regress
parent4049f099bfc99d5a5f50530f43a44d9b12584b2d (diff)
Improve (or rather, rewrite) tbl(7) option parsing.
* Allow the layout to start after the semicolon on the options line. * Ignore leading commas. * Option arguments cannot contain closing parentheses. * Avoid needless UNSUPP messages. * Better ERROR reporting. * Delete unused "linesize" field in struct tbl_opts. * No need for static buffers. * Garbage collect one almost empty wrapper function. Improved functionality, but minus 40 lines of code.
Diffstat (limited to 'regress')
-rw-r--r--regress/usr.bin/mandoc/tbl/Makefile6
-rw-r--r--regress/usr.bin/mandoc/tbl/opt.in19
-rw-r--r--regress/usr.bin/mandoc/tbl/opt.out_ascii24
-rw-r--r--regress/usr.bin/mandoc/tbl/opt.out_lint4
4 files changed, 50 insertions, 3 deletions
diff --git a/regress/usr.bin/mandoc/tbl/Makefile b/regress/usr.bin/mandoc/tbl/Makefile
index 270fcf9c0bb..83d48a226cb 100644
--- a/regress/usr.bin/mandoc/tbl/Makefile
+++ b/regress/usr.bin/mandoc/tbl/Makefile
@@ -1,8 +1,8 @@
-# $OpenBSD: Makefile,v 1.7 2015/01/21 00:45:16 schwarze Exp $
+# $OpenBSD: Makefile,v 1.8 2015/01/26 00:54:09 schwarze Exp $
REGRESS_TARGETS = blankline center fonts macro misalign
-REGRESS_TARGETS += nested numbers span vert
-LINT_TARGETS = macro nested
+REGRESS_TARGETS += nested numbers opt span vert
+LINT_TARGETS = macro nested opt
# groff-1.22.3 defect:
# - When space is insufficient (on either side) for properly aligning
diff --git a/regress/usr.bin/mandoc/tbl/opt.in b/regress/usr.bin/mandoc/tbl/opt.in
new file mode 100644
index 00000000000..e21a9b687ef
--- /dev/null
+++ b/regress/usr.bin/mandoc/tbl/opt.in
@@ -0,0 +1,19 @@
+.TH TBL-OPT 1 "January 25, 2015" OpenBSD
+.SH NAME
+tbl-opt \- table options
+.SH DESCRIPTION
+normal text
+.TS
+tab decimalpoint (,x) %foo box;
+n n .
+10.0 0.01
+0.01 10.0
+.TE
+.PP
+normal text
+.TS
+ , box,tab(:); l l .
+a:b
+.TE
+.PP
+normal text
diff --git a/regress/usr.bin/mandoc/tbl/opt.out_ascii b/regress/usr.bin/mandoc/tbl/opt.out_ascii
new file mode 100644
index 00000000000..320b8023c0e
--- /dev/null
+++ b/regress/usr.bin/mandoc/tbl/opt.out_ascii
@@ -0,0 +1,24 @@
+TBL-OPT(1) General Commands Manual TBL-OPT(1)
+
+
+
+NNAAMMEE
+ tbl-opt - table options
+
+DDEESSCCRRIIPPTTIIOONN
+ normal text
+
+ +--------------+
+ |10.0 0.01 |
+ | 0.01 10.0 |
+ +--------------+
+ normal text
+
+ +------+
+ |a b |
+ +------+
+ normal text
+
+
+
+OpenBSD January 25, 2015 TBL-OPT(1)
diff --git a/regress/usr.bin/mandoc/tbl/opt.out_lint b/regress/usr.bin/mandoc/tbl/opt.out_lint
new file mode 100644
index 00000000000..85ba35cf7c4
--- /dev/null
+++ b/regress/usr.bin/mandoc/tbl/opt.out_lint
@@ -0,0 +1,4 @@
+mandoc: opt.in:7:5: ERROR: missing tbl option argument: tab
+mandoc: opt.in:7:19: ERROR: wrong tbl option argument size: decimalpoint want 1 have 2
+mandoc: opt.in:7:23: ERROR: non-alphabetic character in tbl options: %
+mandoc: opt.in:7:24: ERROR: skipping unknown tbl option: foo