summaryrefslogtreecommitdiff
path: root/regress
diff options
context:
space:
mode:
Diffstat (limited to 'regress')
-rw-r--r--regress/usr.bin/join/Makefile40
-rw-r--r--regress/usr.bin/join/fa13
-rw-r--r--regress/usr.bin/join/fa22
-rw-r--r--regress/usr.bin/join/fax4
-rw-r--r--regress/usr.bin/join/fb11
-rw-r--r--regress/usr.bin/join/fb23
-rw-r--r--regress/usr.bin/join/phone4
-rw-r--r--regress/usr.bin/join/t1.out5
-rw-r--r--regress/usr.bin/join/t2.out3
-rw-r--r--regress/usr.bin/join/t3.out6
-rw-r--r--regress/usr.bin/join/t4.out3
-rw-r--r--regress/usr.bin/join/t4a.in3
-rw-r--r--regress/usr.bin/join/t4b.in2
-rw-r--r--regress/usr.bin/join/t5.out2
-rw-r--r--regress/usr.bin/join/t6.out3
15 files changed, 84 insertions, 0 deletions
diff --git a/regress/usr.bin/join/Makefile b/regress/usr.bin/join/Makefile
new file mode 100644
index 00000000000..872dd006934
--- /dev/null
+++ b/regress/usr.bin/join/Makefile
@@ -0,0 +1,40 @@
+# $OpenBSD: Makefile,v 1.1 2018/10/15 08:08:13 otto Exp $
+
+JION=join
+
+REGRESS_TARGETS=t1 t2 t3 # t4 t5 t6
+
+t1:
+ join -t " " -a 1 -a 2 -e '(unknown)' -o 0,1.2,2.2 ${.CURDIR}/phone ${.CURDIR}/fax > ${*}.log
+ @cmp -s ${.CURDIR}/${*}.out ${*}.log || \
+ (echo "XXX ${*} failed" && false)
+
+t2:
+ join ${.CURDIR}/fa1 ${.CURDIR}/fb1 > ${*}.log
+ @cmp -s ${.CURDIR}/${*}.out ${*}.log || \
+ (echo "XXX ${*} failed" && false)
+
+t3:
+ join ${.CURDIR}/fa2 ${.CURDIR}/fb2 > ${*}.log
+ @cmp -s ${.CURDIR}/${*}.out ${*}.log || \
+ (echo "XXX ${*} failed" && false)
+
+t4:
+ join -t, -o0,1.2,1.3,2.2,2.3 -a1 ${.CURDIR}/t4a.in ${.CURDIR}/t4b.in > ${*}.log
+ @cmp -s ${.CURDIR}/${*}.out ${*}.log || \
+ (echo "XXX ${*} failed" && false)
+
+t5:
+ join -t, -o0,1.2,1.3,2.2,2.3 -a2 ${.CURDIR}/t4a.in ${.CURDIR}/t4b.in > ${*}.log
+ @cmp -s ${.CURDIR}/${*}.out ${*}.log || \
+ (echo "XXX ${*} failed" && false)
+
+t6:
+ join -t, -o0,1.2,1.3,2.2,2.3 -a1 -a2 ${.CURDIR}/t4a.in ${.CURDIR}/t4b.in > ${*}.log
+ @cmp -s ${.CURDIR}/${*}.out ${*}.log || \
+ (echo "XXX ${*} failed" && false)
+
+clean:
+ rm -f *.log
+
+.include <bsd.regress.mk>
diff --git a/regress/usr.bin/join/fa1 b/regress/usr.bin/join/fa1
new file mode 100644
index 00000000000..7cba3cec624
--- /dev/null
+++ b/regress/usr.bin/join/fa1
@@ -0,0 +1,3 @@
+a x
+a y
+a z
diff --git a/regress/usr.bin/join/fa2 b/regress/usr.bin/join/fa2
new file mode 100644
index 00000000000..68e22927799
--- /dev/null
+++ b/regress/usr.bin/join/fa2
@@ -0,0 +1,2 @@
+a b c
+a d e
diff --git a/regress/usr.bin/join/fax b/regress/usr.bin/join/fax
new file mode 100644
index 00000000000..f56167dee87
--- /dev/null
+++ b/regress/usr.bin/join/fax
@@ -0,0 +1,4 @@
+!Name Fax Number
+Don +1 123-456-7899
+Keith +1 456-789-0122
+Yasushi +2 345-678-9011
diff --git a/regress/usr.bin/join/fb1 b/regress/usr.bin/join/fb1
new file mode 100644
index 00000000000..60a05b94ea5
--- /dev/null
+++ b/regress/usr.bin/join/fb1
@@ -0,0 +1 @@
+a p
diff --git a/regress/usr.bin/join/fb2 b/regress/usr.bin/join/fb2
new file mode 100644
index 00000000000..58fbd6a49d5
--- /dev/null
+++ b/regress/usr.bin/join/fb2
@@ -0,0 +1,3 @@
+a w x
+a y z
+a o p
diff --git a/regress/usr.bin/join/phone b/regress/usr.bin/join/phone
new file mode 100644
index 00000000000..fd95cff6542
--- /dev/null
+++ b/regress/usr.bin/join/phone
@@ -0,0 +1,4 @@
+!Name Phone Number
+Don +1 123-456-7890
+Hal +1 234-567-8901
+Yasushi +2 345-678-9012
diff --git a/regress/usr.bin/join/t1.out b/regress/usr.bin/join/t1.out
new file mode 100644
index 00000000000..0227f8e620a
--- /dev/null
+++ b/regress/usr.bin/join/t1.out
@@ -0,0 +1,5 @@
+!Name Phone Number Fax Number
+Don +1 123-456-7890 +1 123-456-7899
+Hal +1 234-567-8901 (unknown)
+Keith (unknown) +1 456-789-0122
+Yasushi +2 345-678-9012 +2 345-678-9011
diff --git a/regress/usr.bin/join/t2.out b/regress/usr.bin/join/t2.out
new file mode 100644
index 00000000000..1a1eb7a25e9
--- /dev/null
+++ b/regress/usr.bin/join/t2.out
@@ -0,0 +1,3 @@
+a x p
+a y p
+a z p
diff --git a/regress/usr.bin/join/t3.out b/regress/usr.bin/join/t3.out
new file mode 100644
index 00000000000..151a1a277d2
--- /dev/null
+++ b/regress/usr.bin/join/t3.out
@@ -0,0 +1,6 @@
+a b c w x
+a b c y z
+a b c o p
+a d e w x
+a d e y z
+a d e o p
diff --git a/regress/usr.bin/join/t4.out b/regress/usr.bin/join/t4.out
new file mode 100644
index 00000000000..d5bec96f6da
--- /dev/null
+++ b/regress/usr.bin/join/t4.out
@@ -0,0 +1,3 @@
+1,A1,B1,A2,B2
+2,,,,
+3,E1,F1,E2,F2
diff --git a/regress/usr.bin/join/t4a.in b/regress/usr.bin/join/t4a.in
new file mode 100644
index 00000000000..91ddbfdbfcc
--- /dev/null
+++ b/regress/usr.bin/join/t4a.in
@@ -0,0 +1,3 @@
+1,A1,B1
+2
+3,E1,F1
diff --git a/regress/usr.bin/join/t4b.in b/regress/usr.bin/join/t4b.in
new file mode 100644
index 00000000000..f4f203780e4
--- /dev/null
+++ b/regress/usr.bin/join/t4b.in
@@ -0,0 +1,2 @@
+1,A2,B2
+3,E2,F2
diff --git a/regress/usr.bin/join/t5.out b/regress/usr.bin/join/t5.out
new file mode 100644
index 00000000000..de38dfdabac
--- /dev/null
+++ b/regress/usr.bin/join/t5.out
@@ -0,0 +1,2 @@
+1,A1,B1,A2,B2
+3,E1,F1,E2,F2
diff --git a/regress/usr.bin/join/t6.out b/regress/usr.bin/join/t6.out
new file mode 100644
index 00000000000..d5bec96f6da
--- /dev/null
+++ b/regress/usr.bin/join/t6.out
@@ -0,0 +1,3 @@
+1,A1,B1,A2,B2
+2,,,,
+3,E1,F1,E2,F2