From c1103834065bbd1182a90b9723dbd89a4a908731 Mon Sep 17 00:00:00 2001 From: Tavian Barnes Date: Mon, 2 Oct 2023 14:13:49 -0400 Subject: tests: Fix make_deep() on FreeBSD I keep forgetting that PATH_MAX is only 1024 there. --- tests/tests.sh | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/tests/tests.sh b/tests/tests.sh index 121cd85..663f5aa 100755 --- a/tests/tests.sh +++ b/tests/tests.sh @@ -389,18 +389,19 @@ function make_deep() { name="${name}${name}${name}${name}" name="${name:0:255}" - # 4 * 256 - 1 == 1023 - local names="$name/$name/$name/$name" - for i in {0..9} A B C D E F; do "$XTOUCH" -p "$1/$i/$name" - # 4 * 1024 == 4096 == PATH_MAX - for _ in {1..4}; do - mv "$1/$i/$name" "$1/" - mkdir -p "$1/$i/$names" - mv "$1/$name" "$1/$i/$names/" - done + ( + cd "$1/$i" + + # 8 * 512 == 4096 >= PATH_MAX + for _ in {1..8}; do + mv "$name" .. + mkdir -p "$name/$name" + mv "../$name" "$name/$name/" + done + ) done } make_deep "$TMP/deep" -- cgit v1.2.3