- Fix UTF-8 regression test when running with LC_{CTYPE,ALL}=C by setting
authormartijn <martijn@openbsd.org>
Mon, 12 Nov 2018 09:48:48 +0000 (09:48 +0000)
committermartijn <martijn@openbsd.org>
Mon, 12 Nov 2018 09:48:48 +0000 (09:48 +0000)
LC_ALL to UTF-8.
- Add explicit regression test for when locale C

Found the hard way by tb@.
input and OK on earlier version bluhm@

regress/usr.bin/join/Makefile
regress/usr.bin/join/t9-c.out [new file with mode: 0644]
regress/usr.bin/join/t9-utf8.out [new file with mode: 0644]
regress/usr.bin/join/t9.out [deleted file]

index fc77560..a29fc19 100644 (file)
@@ -1,8 +1,6 @@
-# $OpenBSD: Makefile,v 1.4 2018/11/06 13:59:09 martijn Exp $
+# $OpenBSD: Makefile,v 1.5 2018/11/12 09:48:48 martijn Exp $
 
-JION=join
-
-REGRESS_TARGETS=t1 t2 t3 t4 t5 t6 t7 t8 t9
+REGRESS_TARGETS=t1 t2 t3 t4 t5 t6 t7 t8 t9-utf8 t9-c
 
 t1:
        join -t "       " -a 1 -a 2 -e '(unknown)' -o 0,1.2,2.2 ${.CURDIR}/phone ${.CURDIR}/fax > ${*}.log
@@ -44,8 +42,15 @@ t8:
        @cmp -s ${.CURDIR}/${*}.out ${*}.log || \
                (echo "XXX ${*} failed" && false)
 
-t9:
-       join -t‐ ${.CURDIR}/t9a.in ${.CURDIR}/t9b.in > ${*}.log
+
+# LC_ALL takes precedence over LC_CTYPE.
+t9-utf8:
+       LC_ALL=en_US.UTF-8 join -t‐ ${.CURDIR}/t9a.in ${.CURDIR}/t9b.in > ${*}.log
+       @cmp -s ${.CURDIR}/${*}.out ${*}.log || \
+               (echo "XXX ${*} failed" && false)
+
+t9-c:
+       ! LC_ALL=C join -t‐ ${.CURDIR}/t9a.in ${.CURDIR}/t9b.in > ${*}.log 2>&1
        @cmp -s ${.CURDIR}/${*}.out ${*}.log || \
                (echo "XXX ${*} failed" && false)
 
diff --git a/regress/usr.bin/join/t9-c.out b/regress/usr.bin/join/t9-c.out
new file mode 100644 (file)
index 0000000..ea05035
--- /dev/null
@@ -0,0 +1 @@
+join: illegal tab character specification
diff --git a/regress/usr.bin/join/t9-utf8.out b/regress/usr.bin/join/t9-utf8.out
new file mode 100644 (file)
index 0000000..131ff7d
--- /dev/null
@@ -0,0 +1 @@
+a‐b‐c‐d‐e
diff --git a/regress/usr.bin/join/t9.out b/regress/usr.bin/join/t9.out
deleted file mode 100644 (file)
index 131ff7d..0000000
+++ /dev/null
@@ -1 +0,0 @@
-a‐b‐c‐d‐e