aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohn Ankarström <john@ankarstrom.se>2021-06-21 14:33:37 +0200
committerJohn Ankarström <john@ankarstrom.se>2021-06-21 14:34:48 +0200
commitb1ddb4001d5e3f0ef17ce2cc1363140efb733419 (patch)
treec484ca8e79823c997d01bf84ff9f63541ee6dc43
parent0fc33e53e2fd1410c2b2ea71bb21afcebee93a29 (diff)
downloadmk-b1ddb4001d5e3f0ef17ce2cc1363140efb733419.tar.gz
ne.t: Test s l, s ll
-rw-r--r--t/Makefile8
-rw-r--r--t/ne.pdfbin14878 -> 0 bytes
-rw-r--r--t/ne.t116
-rw-r--r--t/t.tmac12
4 files changed, 115 insertions, 21 deletions
diff --git a/t/Makefile b/t/Makefile
index 6027724..58e5d3d 100644
--- a/t/Makefile
+++ b/t/Makefile
@@ -3,9 +3,13 @@ TEST != ls *.t | sed 's/t$$/T/'
all: $(TEST)
-.t.T:
+g.tmac: ../g.tmac
+ cp g.tmac g.tmac.orig
+ grep -v '^\. *w ' ../g.tmac > g.tmac
+
+.t.T: g.tmac t.tmac
@echo -- $< -----------------------
@groff -Tps $< >/dev/null
-.t.pdf:
+.t.pdf: g.tmac t.tmac
groff -Tps $< | ps2pdf - > $@
diff --git a/t/ne.pdf b/t/ne.pdf
deleted file mode 100644
index c3f7c5c..0000000
--- a/t/ne.pdf
+++ /dev/null
Binary files differ
diff --git a/t/ne.t b/t/ne.t
index 564f686..14a2133 100644
--- a/t/ne.t
+++ b/t/ne.t
@@ -1,4 +1,4 @@
-.so ../g.tmac
+.so g.tmac
.so t.tmac
.
.t
@@ -10,19 +10,19 @@ macro.
.
.\" helper macros
.
-.\" make space for exactly 's pp' at bottom of page
-.de makespace
+.\" make space at bottom of page
+.de @
. rs
. rt 0
-. sp \n(.pu-\n(mbu-39601u
-. nr _ \\n%
+. sp \n(.pu-\n(mbu-\\$1-1u
+. nr a \\n%
..
.
-.\" write 's pp'
-.de write
+.\" write 's pppp'
+.de *spppp
. s
. nr s \\n%
-Lorem ipsum
+Test \\nt
. p
. nr p \\n%
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do
@@ -35,30 +35,112 @@ cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat
cupidatat non proident, sunt in culpa qui officia deserunt mollit
anim id est laborum.
..
+.de *sllll
+. s
+Test \\nt
+. nr s \\n%
+. l
+. nr l \\n%
+first line
+. nr ll \\n%
+second line
+. nr lll \\n%
+third line
+fourth line
+..
.
.\" run tests
.
.test s pp +0u
.bp
-.makespace
+.@ 39600u
.w s pp
-.write
-.assert (\n_=\ns)&(\ns=\np)&(\np=\n(pp)
+.*spppp
+.assert (`na=`ns)&(`ns=`np)&(`np=`n(pp)
.
.test s pp +1u
.bp
-.makespace
+.@ 39600u
.sp 1u
.w s pp
-.write
-.assert (\n_<\ns)&(\ns=\np)&(\np=\n(pp)
+.*spppp
+.assert (`na<`ns)&(`ns=`np)&(`np=`n(pp)
.
.test s pp +2u
.bp
-.makespace
+.@ 39600u
.sp 2u
.w s pp
-.write
-.assert (\n_<\ns)&(\ns=\np)&(\np=\n(pp)
+.*spppp
+.assert (`na<`ns)&(`ns=`np)&(`np=`n(pp)
+.
+.test s p +0u
+.bp
+.@ 27600u
+.w s p
+.*spppp
+.assert (`na=`ns)&(`ns=`np)&(`np<`n(pp)
+.
+.test s p +1u
+.bp
+.@ 27600u
+.sp 1u
+.w s p
+.*spppp
+.assert (`na<`ns)&(`ns=`np)&(`np=`n(pp)
+.
+.test s p +2u
+.bp
+.@ 27600u
+.sp 2u
+.w s p
+.*spppp
+.assert (`na<`ns)&(`ns=`np)&(`np=`n(pp)
+.
+.test s l +0u
+.bp
+.@ 27600u
+.w s l
+.*sllll
+.assert (`na=`ns)&(`ns=`nl)&(`nl<`n(ll)&(`n(ll=`n[lll])
+.
+.test s l +1u
+.bp
+.@ 27600u
+.sp 1u
+.w s l
+.*sllll
+.assert (`na<`ns)&(`ns=`nl)&(`nl=`n(ll)&(`n(ll=`n[lll])
+.
+.test s l +2u
+.bp
+.@ 27600u
+.sp 2u
+.w s l
+.*sllll
+.assert (`na<`ns)&(`ns=`nl)&(`nl=`n(ll)&(`n(ll=`n[lll])
+.
+.test s ll +0u
+.bp
+.@ 38600u
+.w s ll
+.*sllll
+.assert (`na=`ns)&(`ns=`nl)&(`nl=`n(ll)&(`n(ll<`n[lll])
+.
+.test s ll +1u
+.bp
+.@ 38600u
+.sp 1u
+.w s ll
+.*sllll
+.assert (`na<`ns)&(`ns=`nl)&(`nl=`n(ll)&(`n(ll=`n[lll])
+.
+.test s ll +2u
+.bp
+.@ 38600u
+.sp 2u
+.w s ll
+.*sllll
+.assert (`na<`ns)&(`ns=`nl)&(`nl=`n(ll)&(`n(ll=`n[lll])
.
.end
diff --git a/t/t.tmac b/t/t.tmac
index c266c1f..e2c1dab 100644
--- a/t/t.tmac
+++ b/t/t.tmac
@@ -6,12 +6,20 @@
.
.\" make assertion
.de assert
-.ie \\$1 \{\
+.ec `
+.ie `$1 \{\
. tm1 " success
.\}
+.ec
.el \{\
-. tm1 " failure: \\$1
+. if \\nF<\\nt .tm1 " failure:
+.ec `
+. ds *exp `$1
+.ec
+. tm1 "{ \\*[*exp]
+. if !'\\*[*exp]'\\$1' . tm1 "} \\$1
. nr f +1
+. nr F \\nt
.\}
..
.\" end tests