[hackers] [sbase] tests: Merge stderr and stdout in 0002-printf.sh || Roberto E. Vargas Caballero
commit a1bf3adbc5f69f236319b99bd0a6aab6138c0014
Author: Roberto E. Vargas Caballero <k0ga_AT_shike2.net>
AuthorDate: Tue Jan 13 15:31:46 2026 +0100
Commit: Roberto E. Vargas Caballero <k0ga_AT_shike2.net>
CommitDate: Tue Jan 13 15:31:46 2026 +0100
tests: Merge stderr and stdout in 0002-printf.sh
It simplifies the test shell script.
diff --git a/tests/0002-printf.sh b/tests/0002-printf.sh
index dd57e06..04be2d2 100755
--- a/tests/0002-printf.sh
+++ b/tests/0002-printf.sh
_AT_@ -2,10 +2,9 @@
set -e
-res1=tmp1.$$
-res2=tmp2.$$
+tmp=tmp.$$
-trap 'rm -f $res1 $res2' EXIT
+trap 'rm -f $tmp' EXIT
trap 'exit $?' HUP INT TERM
(
_AT_@ -17,17 +16,14 @@ trap 'exit $?' HUP INT TERM
$EXEC ../printf '%+04d %+4d ' 1 2 3 -400; ../printf "\n"
# Missing format specifier; should have sane error message
$EXEC ../printf '%000' FOO || echo "Expected failure"
-) > $res1 2> $res2
+) > $tmp 2>&1
-diff -u - $res1 <<'EOF'
+diff -u - $tmp <<'EOF'
123
0
foo
bar
+001 +2 +003 -400
-Expected failure
-EOF
-
-diff -u - $res2 <<'EOF'
../printf: Missing format specifier.
+Expected failure
EOF
Received on Tue Jan 13 2026 - 15:32:40 CET
This archive was generated by hypermail 2.3.0
: Tue Jan 13 2026 - 15:36:11 CET