summaryrefslogtreecommitdiffstats
path: root/tests.sh
diff options
context:
space:
mode:
authorTavian Barnes <tavianator@tavianator.com>2017-06-11 20:41:09 -0400
committerTavian Barnes <tavianator@tavianator.com>2017-06-11 20:41:09 -0400
commit45f5b5d2ecf2fea8ecf5817df22d1cbbab3518d1 (patch)
treeec3b8ddd108fd1ddf60b5ed625c1001291be708f /tests.sh
parenta3faa73f03a4d539de4c808d1a4f3b8ebc5ce537 (diff)
downloadbfs-45f5b5d2ecf2fea8ecf5817df22d1cbbab3518d1.tar.xz
tests: Fix test_printf_nul with non-GNU sort
Other UNIX sort implementations seem to truncate at the nul bytes, so open-code it without the sort.
Diffstat (limited to 'tests.sh')
-rwxr-xr-xtests.sh8
1 files changed, 7 insertions, 1 deletions
diff --git a/tests.sh b/tests.sh
index ef4bbfc..c518f33 100755
--- a/tests.sh
+++ b/tests.sh
@@ -1039,7 +1039,13 @@ function test_printf_leak() {
function test_printf_nul() {
# NUL byte regression test
- bfs_diff basic -printf '%h\0%f\n'
+ local OUT="$TESTS/${FUNCNAME[0]}.out"
+ local ARGS=(basic -maxdepth 0 -printf '%h\0%f\n')
+ if [ "$UPDATE" ]; then
+ $BFS "${ARGS[@]}" >"$OUT"
+ else
+ diff -u "$OUT" <($BFS "${ARGS[@]}")
+ fi
}
function test_fstype() {