From 45f5b5d2ecf2fea8ecf5817df22d1cbbab3518d1 Mon Sep 17 00:00:00 2001 From: Tavian Barnes Date: Sun, 11 Jun 2017 20:41:09 -0400 Subject: 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. --- tests.sh | 8 +++++++- tests/test_printf_nul.out | Bin 198 -> 8 bytes 2 files changed, 7 insertions(+), 1 deletion(-) 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() { diff --git a/tests/test_printf_nul.out b/tests/test_printf_nul.out index 3e30a4f..6833fdd 100644 Binary files a/tests/test_printf_nul.out and b/tests/test_printf_nul.out differ -- cgit v1.2.3