From 962d715ce2dee7a017dacca3b787ade6d33cd1c6 Mon Sep 17 00:00:00 2001 From: Tavian Barnes Date: Fri, 20 Oct 2023 11:18:25 -0400 Subject: tests: Use xtouch to create the whole deep tree at once --- tests/stddirs.sh | 21 ++++++--------------- 1 file changed, 6 insertions(+), 15 deletions(-) diff --git a/tests/stddirs.sh b/tests/stddirs.sh index e7f7246..acc23dc 100644 --- a/tests/stddirs.sh +++ b/tests/stddirs.sh @@ -79,24 +79,15 @@ make_deep() { # $name will be 255 characters, aka _XOPEN_NAME_MAX local name="0123456789ABCDEF" - name="${name}${name}${name}${name}" - name="${name}${name}${name}${name}" + name="$name$name$name$name" + name="$name$name$name$name" name="${name:0:255}" - for i in {0..9} A B C D E F; do - "$XTOUCH" -p "$1/$i/$name" + # 4 * 4 * 256 == 4096 >= PATH_MAX + local path="$name/$name/$name/$name" + path="$path/$path/$path/$path" - ( - 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 + "$XTOUCH" -p "$1"/{{0..9},A,B,C,D,E,F}/"$path/$name" } # Creates a directory structure with many different types, and therefore colors -- cgit v1.2.3