summaryrefslogtreecommitdiffstats
path: root/tests.sh
diff options
context:
space:
mode:
authorTavian Barnes <tavianator@tavianator.com>2022-03-13 13:32:44 -0400
committerTavian Barnes <tavianator@tavianator.com>2022-03-13 13:44:32 -0400
commit851942e235fe17869d7e7f2b3cc4d559f1e90e89 (patch)
treefae14d24f9be3ec20d1b668ac9eed05d3438a153 /tests.sh
parentfa767895d4165dc9b0a8808f4760141067e0ea12 (diff)
downloadbfs-851942e235fe17869d7e7f2b3cc4d559f1e90e89.tar.xz
tests: Use plain sort, not bfs_sort
bfs_sort existed to keep the test outputs nicely in breadth-first order. Unfortunately the implementation using awk didn't support NUL bytes.
Diffstat (limited to 'tests.sh')
-rwxr-xr-xtests.sh19
1 files changed, 2 insertions, 17 deletions
diff --git a/tests.sh b/tests.sh
index d41f875..5370249 100755
--- a/tests.sh
+++ b/tests.sh
@@ -1069,10 +1069,6 @@ function make_scratch() {
}
make_scratch "$TMP/scratch"
-function bfs_sort() {
- awk -F/ '{ print NF - 1 " " $0 }' | sort -n | cut -d' ' -f2-
-}
-
# Close stdin so bfs doesn't think we're interactive
exec </dev/null
@@ -1174,7 +1170,7 @@ function bfs_diff() (
local ACTUAL="$TMP/$CALLER.out"
fi
- $BFS "$@" | bfs_sort >"$ACTUAL"
+ $BFS "$@" | sort >"$ACTUAL"
local STATUS="${PIPESTATUS[0]}"
if [ ! "$UPDATE" ]; then
@@ -2395,18 +2391,7 @@ function test_printf_leak() {
function test_printf_nul() {
# NUL byte regression test
- local EXPECTED="$TESTS/${FUNCNAME[0]}.out"
- if [ "$UPDATE" ]; then
- local ACTUAL="$EXPECTED"
- else
- local ACTUAL="$TMP/${FUNCNAME[0]}.out"
- fi
-
- invoke_bfs basic -maxdepth 0 -printf '%h\0%f\n' >"$ACTUAL"
-
- if [ ! "$UPDATE" ]; then
- $DIFF -u "$EXPECTED" "$ACTUAL"
- fi
+ bfs_diff basic -maxdepth 0 -printf '%h\0%f\n'
}
function test_printf_w() {