commit: 2b9a1206e400a30309fe7aae8d508f95151302be
parent d8b72437f6ad9dd9553532c9e8b4a0918c7aad25
Author: Haelwenn (lanodan) Monnier <contact@hacktivis.me>
Date: Tue, 3 Sep 2024 17:45:49 +0200
test-cmd/join: new
Diffstat:
9 files changed, 59 insertions(+), 2 deletions(-)
diff --git a/.reuse/dep5 b/.reuse/dep5
@@ -1,10 +1,10 @@
Format: https://www.debian.org/doc/packaging-manuals/copyright-format/1.0/
Source: https://hacktivis.me/git/utils
-Files: test-cmd/inputs/* test-cmd/outputs/* authorized_keys.git
+Files: test-cmd/inputs/* test-cmd/outputs/* authorized_keys.git test-cmd/inputs/join/*.txt
Copyright: 2017-2024 Haelwenn (lanodan) Monnier <contact+utils@hacktivis.me>
License: CC0-1.0
-Files: test-cmd/uniq_0I.txt
+Files: test-cmd/uniq_0I.txt test-cmd/inputs/join/*-*
License: CC0-1.0
Copyright: IEEE Std 1003.1-2008 (“POSIX.1”)
diff --git a/test-cmd/Kyuafile b/test-cmd/Kyuafile
@@ -26,6 +26,7 @@ tap_test_program{name="expr.sh", required_files=basedir.."/cmd/expr", timeout=1}
tap_test_program{name="false.sh", required_files=basedir.."/cmd/false", timeout=1}
tap_test_program{name="head.sh", required_files=basedir.."/cmd/head", timeout=1}
tap_test_program{name="id.sh", required_files=basedir.."/cmd/id", timeout=1}
+tap_test_program{name="join.sh", required_files=basedir.."/cmd/join", timeout=1}
tap_test_program{name="link.sh", required_files=basedir.."/cmd/link", timeout=1}
tap_test_program{name="logname.sh", required_files=basedir.."/cmd/logname", timeout=1}
tap_test_program{name="mktemp.sh", required_files=basedir.."/cmd/mktemp", timeout=1}
diff --git a/test-cmd/inputs/join/abc-ade b/test-cmd/inputs/join/abc-ade
@@ -0,0 +1,2 @@
+a b c
+a d e
diff --git a/test-cmd/inputs/join/ap b/test-cmd/inputs/join/ap
@@ -0,0 +1 @@
+a p
+\ No newline at end of file
diff --git a/test-cmd/inputs/join/awx-aop b/test-cmd/inputs/join/awx-aop
@@ -0,0 +1,3 @@
+a w x
+a y z
+a o p
+\ No newline at end of file
diff --git a/test-cmd/inputs/join/ax-az b/test-cmd/inputs/join/ax-az
@@ -0,0 +1,3 @@
+a x
+a y
+a z
diff --git a/test-cmd/inputs/join/origin.txt b/test-cmd/inputs/join/origin.txt
@@ -0,0 +1,4 @@
+!Name Origin
+Mary Sneakers (1992 film)
+Аквариум Russian band
+Ann Frasier
diff --git a/test-cmd/inputs/join/phone.txt b/test-cmd/inputs/join/phone.txt
@@ -0,0 +1,4 @@
+!Name Phone Number
+Mary +1 (415) 273-9164
+Аквариум +7 212-85-06
+Ann 555-0179
diff --git a/test-cmd/join.sh b/test-cmd/join.sh
@@ -0,0 +1,37 @@
+#!/bin/sh
+# SPDX-FileCopyrightText: 2017 Haelwenn (lanodan) Monnier <contact+utils@hacktivis.me>
+# SPDX-License-Identifier: MPL-2.0
+
+WD="$(dirname "$0")/../"
+target="${WD}/cmd/join"
+plans=3
+. "${WD}/test-cmd/tap.sh"
+
+t_args phones_fiction \
+'!Name Phone Number Origin
+Mary +1 (415) 273-9164 Sneakers (1992 film)
+Аквариум +7 212-85-06 Russian band
+Ann 555-0179 Frasier
+' \
+ -t ' ' -a 1 -a 2 -e '(unknown)' -o 0,1.2,2.2 \
+ "${WD}/test-cmd/inputs/join/phone.txt" \
+ "${WD}/test-cmd/inputs/join/origin.txt"
+
+t_args posix_ax_az_ap \
+'a x p
+a y p
+a z p
+' \
+ "${WD}/test-cmd/inputs/join/ax-az" \
+ "${WD}/test-cmd/inputs/join/ap"
+
+t_args posix_ac_ae_ap \
+'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
+' \
+ "${WD}/test-cmd/inputs/join/abc-ade" \
+ "${WD}/test-cmd/inputs/join/awx-aop"