summaryrefslogtreecommitdiff
path: root/regress/usr.bin/mandoc
diff options
context:
space:
mode:
authorIngo Schwarze <schwarze@cvs.openbsd.org>2015-01-30 00:27:10 +0000
committerIngo Schwarze <schwarze@cvs.openbsd.org>2015-01-30 00:27:10 +0000
commit3baae144ee3fc4330e6d84f6a382e3c7d3c1f9bd (patch)
tree2d5080cbd78df3cb351cc88d61aee00b3b5dfba5 /regress/usr.bin/mandoc
parent94b5e59bfee0219b110324dc50b62048bd744f57 (diff)
Make sure every layout line contains at least one cell;
fixing a NULL pointer access in term_tbl() that jsg@ found with afl.
Diffstat (limited to 'regress/usr.bin/mandoc')
-rw-r--r--regress/usr.bin/mandoc/tbl/layout/Makefile12
-rw-r--r--regress/usr.bin/mandoc/tbl/layout/empty.in15
-rw-r--r--regress/usr.bin/mandoc/tbl/layout/empty.out_ascii19
-rw-r--r--regress/usr.bin/mandoc/tbl/layout/empty.out_lint2
-rw-r--r--regress/usr.bin/mandoc/tbl/layout/emptyline.in24
-rw-r--r--regress/usr.bin/mandoc/tbl/layout/emptyline.out_ascii24
6 files changed, 93 insertions, 3 deletions
diff --git a/regress/usr.bin/mandoc/tbl/layout/Makefile b/regress/usr.bin/mandoc/tbl/layout/Makefile
index 85c6c66d3fa..9ad5d7f93b6 100644
--- a/regress/usr.bin/mandoc/tbl/layout/Makefile
+++ b/regress/usr.bin/mandoc/tbl/layout/Makefile
@@ -1,6 +1,12 @@
-# $OpenBSD: Makefile,v 1.1 2015/01/29 23:24:24 schwarze Exp $
+# $OpenBSD: Makefile,v 1.2 2015/01/30 00:27:09 schwarze Exp $
-REGRESS_TARGETS = center complex numbers span
-LINT_TARGETS = complex
+REGRESS_TARGETS = center complex empty emptyline numbers span
+LINT_TARGETS = complex empty
+
+# groff-1.22.3 defect:
+# - When the layout is completely empty,
+# GNU eqn produces no output whatsoever for the whole table.
+
+SKIP_GROFF = empty
.include <bsd.regress.mk>
diff --git a/regress/usr.bin/mandoc/tbl/layout/empty.in b/regress/usr.bin/mandoc/tbl/layout/empty.in
new file mode 100644
index 00000000000..3afff9557a9
--- /dev/null
+++ b/regress/usr.bin/mandoc/tbl/layout/empty.in
@@ -0,0 +1,15 @@
+.TH TBL-LAYOUT-EMPTY 1 "January 29, 2015" OpenBSD
+.SH NAME
+tbl-layout-empty \- empty table layout
+.SH DESCRIPTION
+completely empty layout:
+.TS
+.
+table text
+.TE
+layout only contains a bar:
+.TS
+|.
+table text
+.TE
+normal text
diff --git a/regress/usr.bin/mandoc/tbl/layout/empty.out_ascii b/regress/usr.bin/mandoc/tbl/layout/empty.out_ascii
new file mode 100644
index 00000000000..96d224fa391
--- /dev/null
+++ b/regress/usr.bin/mandoc/tbl/layout/empty.out_ascii
@@ -0,0 +1,19 @@
+TBL-LAYOUT-EMPTY(1) General Commands Manual TBL-LAYOUT-EMPTY(1)
+
+
+
+NNAAMMEE
+ tbl-layout-empty - empty table layout
+
+DDEESSCCRRIIPPTTIIOONN
+ completely empty layout:
+
+ table text
+ layout only contains a bar:
+
+ |table text
+ normal text
+
+
+
+OpenBSD January 29, 2015 TBL-LAYOUT-EMPTY(1)
diff --git a/regress/usr.bin/mandoc/tbl/layout/empty.out_lint b/regress/usr.bin/mandoc/tbl/layout/empty.out_lint
new file mode 100644
index 00000000000..20ae24a5530
--- /dev/null
+++ b/regress/usr.bin/mandoc/tbl/layout/empty.out_lint
@@ -0,0 +1,2 @@
+mandoc: empty.in:7:2: ERROR: empty tbl layout
+mandoc: empty.in:12:3: ERROR: empty tbl layout
diff --git a/regress/usr.bin/mandoc/tbl/layout/emptyline.in b/regress/usr.bin/mandoc/tbl/layout/emptyline.in
new file mode 100644
index 00000000000..647b70dbefe
--- /dev/null
+++ b/regress/usr.bin/mandoc/tbl/layout/emptyline.in
@@ -0,0 +1,24 @@
+.TH TBL-LAYOUT-EMPTYLINE 1 "January 29, 2015" OpenBSD
+.SH NAME
+tbl-layout-emptyline \- empty lines in table layouts
+.SH DESCRIPTION
+An empty line in the middle of a table joins with the next:
+.TS
+l
+|
+r.
+table text
+_
+bar
+right
+.TE
+.PP
+An empty line at the end of a table is discarded:
+.TS
+l
+r
+|.
+table text
+right
+.TE
+normal text
diff --git a/regress/usr.bin/mandoc/tbl/layout/emptyline.out_ascii b/regress/usr.bin/mandoc/tbl/layout/emptyline.out_ascii
new file mode 100644
index 00000000000..230cc597a33
--- /dev/null
+++ b/regress/usr.bin/mandoc/tbl/layout/emptyline.out_ascii
@@ -0,0 +1,24 @@
+TBL-LAYOUT-EMPTYLINE(1) General Commands Manual TBL-LAYOUT-EMPTYLINE(1)
+
+
+
+NNAAMMEE
+ tbl-layout-emptyline - empty lines in table layouts
+
+DDEESSCCRRIIPPTTIIOONN
+ An empty line in the middle of a table joins with the next:
+
+ table text
+ +-----------
+ | bar
+ | right
+
+ An empty line at the end of a table is discarded:
+
+ table text
+ right
+ normal text
+
+
+
+OpenBSD January 29, 2015 TBL-LAYOUT-EMPTYLINE(1)