commit: f28415694089f8ce4f2ccc2bee4cc232d5e46771
parent 5dcf42f1e671e75464ad466142abb866f446f0cd
Author: Haelwenn (lanodan) Monnier <contact@hacktivis.me>
Date: Tue, 17 Sep 2024 11:06:09 +0200
test-cmd/head: normalize wc(1) output
Diffstat:
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/test-cmd/head.sh b/test-cmd/head.sh
@@ -40,15 +40,15 @@ t z3 "-n 3 -z ${WD}/test-cmd/inputs/strings/length" "$(printf '1\0_2\0__3\0')"
set -o pipefail
-head_40c() { </dev/zero "$target" -c 40 | wc -c; }
+head_40c() { </dev/zero "$target" -c 40 | wc -c | awk '{ print $1 }'; }
t_cmd 40c '40
' head_40c
-head_40kc() { </dev/zero "$target" -c 40k | wc -c; }
+head_40kc() { </dev/zero "$target" -c 40k | wc -c | awk '{ print $1 }'; }
t_cmd 40c '40960
' head_40kc
-head_40d() { </dev/zero "$target" -c 40d | wc -c; }
+head_40d() { </dev/zero "$target" -c 40d | wc -c | awk '{ print $1 }'; }
t_cmd --exit=1 40d "head: Unrecognised unit 'd'
0
" head_40d