t: optional input by omitting *.in files
authorMischa POSLAWSKY <perl@shiar.org>
Thu, 3 Oct 2019 20:49:11 +0000 (22:49 +0200)
committerMischa POSLAWSKY <perl@shiar.org>
Fri, 4 Oct 2019 02:38:14 +0000 (04:38 +0200)
Verify t0* work correctly without dummy input.

t/regress.t
t/t0001-version_--version.in [deleted file]
t/t0002-usage_-h_|wc_-l.in [deleted file]
t/t0003-invalid_options_-aZ_|[_$?_=_64_].in [deleted file]

index 8f92ee7958524d98054349813aaad47c0791cd2a..2293efadcec1c6aacdbb0b97749de257f1b61d9d 100755 (executable)
@@ -26,17 +26,18 @@ do
        esac
 done
 
-for candidate in ${@:-t*.in}
+for candidate in ${@:-t*.out}
 do
        test_count=$((test_count+1))
-       file="${candidate%.in}"
-       test -r "$file.in" || continue
-
+       file="${candidate%.out}"
+       input="$file.in"
        name="$(echo ${file#*-} | tr _ \ )"
-       set -- barcat "$file.in"
+
+       set -- barcat
+       [ -r "$input" ] && set -- "$@" "$input"
        case "$name" in *\ -*) set -- "$@" -"${name#* -}";; esac
        case "$name" in
-               *' |'*) set -- sh -c "\$0 \$1 $3" "$@";;
+               *' |'*) set -- sh -c "\$0 \$1 | ${name#* |}" "$@";;
                *)      set -- "$1" "$2" $3
        esac
 
diff --git a/t/t0001-version_--version.in b/t/t0001-version_--version.in
deleted file mode 100644 (file)
index e69de29..0000000
diff --git a/t/t0002-usage_-h_|wc_-l.in b/t/t0002-usage_-h_|wc_-l.in
deleted file mode 100644 (file)
index e69de29..0000000
diff --git a/t/t0003-invalid_options_-aZ_|[_$?_=_64_].in b/t/t0003-invalid_options_-aZ_|[_$?_=_64_].in
deleted file mode 100644 (file)
index e69de29..0000000