From 851942e235fe17869d7e7f2b3cc4d559f1e90e89 Mon Sep 17 00:00:00 2001 From: Tavian Barnes Date: Sun, 13 Mar 2022 13:32:44 -0400 Subject: 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. --- tests.sh | 19 ++----------------- 1 file changed, 2 insertions(+), 17 deletions(-) (limited to 'tests.sh') 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 "$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() { -- cgit v1.2.3