summaryrefslogtreecommitdiff
path: root/regress/usr.bin
diff options
context:
space:
mode:
authorIngo Schwarze <schwarze@cvs.openbsd.org>2018-07-11 20:24:37 +0000
committerIngo Schwarze <schwarze@cvs.openbsd.org>2018-07-11 20:24:37 +0000
commit069d8d89499144bf8c1e49b48204056d0cced8c6 (patch)
tree5c53d0f73faeabe5467e98c89c297fd4dda291c2 /regress/usr.bin
parent2e83644dba684b8d8dee748d7c956edf9914a2c4 (diff)
some regression tests for lam(1) including width measurements;
will be fixed soon and then linked to the build
Diffstat (limited to 'regress/usr.bin')
-rw-r--r--regress/usr.bin/lam/Makefile36
-rw-r--r--regress/usr.bin/lam/expect_Fback.txt7
-rw-r--r--regress/usr.bin/lam/expect_fonly.txt7
-rw-r--r--regress/usr.bin/lam/expect_noarg.txt7
-rw-r--r--regress/usr.bin/lam/expect_pminus.txt7
-rw-r--r--regress/usr.bin/lam/expect_stdio.txt1
-rw-r--r--regress/usr.bin/lam/in1.txt5
-rw-r--r--regress/usr.bin/lam/in2.txt6
-rw-r--r--regress/usr.bin/lam/in3.txt7
9 files changed, 83 insertions, 0 deletions
diff --git a/regress/usr.bin/lam/Makefile b/regress/usr.bin/lam/Makefile
new file mode 100644
index 00000000000..b9032a01595
--- /dev/null
+++ b/regress/usr.bin/lam/Makefile
@@ -0,0 +1,36 @@
+# $OpenBSD: Makefile,v 1.1 2018/07/11 20:24:35 schwarze Exp $
+
+LAM = LC_CTYPE=en_US.UTF-8 lam
+REGRESS_TARGETS = noarg fonly Fback pminus stdio
+CLEANFILES = ${REGRESS_TARGETS:C/^/out_/:C/$/.txt/}
+
+noarg:
+ ${LAM} ${.CURDIR}/in1.txt ${.CURDIR}/in2.txt ${.CURDIR}/in3.txt > \
+ out_noarg.txt
+ diff -u ${.CURDIR}/expect_noarg.txt out_noarg.txt
+
+# also test padding (in1), truncation (in2), and back to default
+fonly:
+ ${LAM} -f 9 ${.CURDIR}/in1.txt -f .9 ${.CURDIR}/in2.txt \
+ ${.CURDIR}/in3.txt > out_fonly.txt
+ diff -u ${.CURDIR}/expect_fonly.txt out_fonly.txt
+
+# also test 0 padding, and padding combined with truncation
+Fback:
+ ${LAM} -F 010 ${.CURDIR}/in1.txt ${.CURDIR}/in2.txt \
+ -f 7.6 ${.CURDIR}/in3.txt > out_Fback.txt
+ diff -u ${.CURDIR}/expect_Fback.txt out_Fback.txt
+
+# also test separator, left alignment, and column padding
+pminus:
+ ${LAM} -S '|' -F 9.9 ${.CURDIR}/in1.txt -P -9.9 ${.CURDIR}/in2.txt \
+ ${.CURDIR}/in3.txt > out_pminus.txt
+ diff -u ${.CURDIR}/expect_pminus.txt out_pminus.txt
+
+# also test line ending and separators
+stdio:
+ printf "11:12;21:22;" | ${LAM} -t ':' - -S= -t ';' - -s '%' > \
+ out_stdio.txt
+ diff -u ${.CURDIR}/expect_stdio.txt out_stdio.txt
+
+.include <bsd.regress.mk>
diff --git a/regress/usr.bin/lam/expect_Fback.txt b/regress/usr.bin/lam/expect_Fback.txt
new file mode 100644
index 00000000000..5a30f413218
--- /dev/null
+++ b/regress/usr.bin/lam/expect_Fback.txt
@@ -0,0 +1,7 @@
+01234567890123456789 123456
+00accent édoubleカオ ascii
+0000comb é0003byte ‒ trunca
+000four 𠀀0badbyte end
+000incom 0000cont end
+0000000two and th
+ three
diff --git a/regress/usr.bin/lam/expect_fonly.txt b/regress/usr.bin/lam/expect_fonly.txt
new file mode 100644
index 00000000000..bdbca839f22
--- /dev/null
+++ b/regress/usr.bin/lam/expect_fonly.txt
@@ -0,0 +1,7 @@
+123456789123456789123456789
+ accent édoubleカascii
+ comb é3byte ‒truncate
+ four 𠀀badbyte end
+ incom cont end
+twoand three
+three only
diff --git a/regress/usr.bin/lam/expect_noarg.txt b/regress/usr.bin/lam/expect_noarg.txt
new file mode 100644
index 00000000000..38c9098e16d
--- /dev/null
+++ b/regress/usr.bin/lam/expect_noarg.txt
@@ -0,0 +1,7 @@
+123456789123456789123456789
+accent édoubleカオascii
+comb é3byte ‒truncate
+four 𠀀badbyte end
+incom cont end
+twoand three
+three only
diff --git a/regress/usr.bin/lam/expect_pminus.txt b/regress/usr.bin/lam/expect_pminus.txt
new file mode 100644
index 00000000000..eb890eabe66
--- /dev/null
+++ b/regress/usr.bin/lam/expect_pminus.txt
@@ -0,0 +1,7 @@
+|123456789|123456789|123456789
+| accent é|doubleカ |ascii
+| comb é|3byte ‒ |truncate
+| four 𠀀|badbyte |end
+| incom |cont |end
+||two |and three
+|| |three onl
diff --git a/regress/usr.bin/lam/expect_stdio.txt b/regress/usr.bin/lam/expect_stdio.txt
new file mode 100644
index 00000000000..8d624c0abc2
--- /dev/null
+++ b/regress/usr.bin/lam/expect_stdio.txt
@@ -0,0 +1 @@
+11=12%21=22% \ No newline at end of file
diff --git a/regress/usr.bin/lam/in1.txt b/regress/usr.bin/lam/in1.txt
new file mode 100644
index 00000000000..2b5982ea88f
--- /dev/null
+++ b/regress/usr.bin/lam/in1.txt
@@ -0,0 +1,5 @@
+123456789
+accent é
+comb é
+four 𠀀
+incom
diff --git a/regress/usr.bin/lam/in2.txt b/regress/usr.bin/lam/in2.txt
new file mode 100644
index 00000000000..8ab95c4755d
--- /dev/null
+++ b/regress/usr.bin/lam/in2.txt
@@ -0,0 +1,6 @@
+123456789
+doubleカオ
+3byte ‒
+badbyte
+cont
+two
diff --git a/regress/usr.bin/lam/in3.txt b/regress/usr.bin/lam/in3.txt
new file mode 100644
index 00000000000..a9ac8129b33
--- /dev/null
+++ b/regress/usr.bin/lam/in3.txt
@@ -0,0 +1,7 @@
+123456789
+ascii
+truncate
+end
+end
+and three
+three only