diff options
author | Elliott Hughes <enh@google.com> | 2019-08-15 08:49:17 -0700 |
---|---|---|
committer | Rob Landley <rob@landley.net> | 2019-08-15 12:00:44 -0500 |
commit | 8762563eb08f690f3a11eb2b641e347c77710394 (patch) | |
tree | 9d9d707fd9694d463c78bf19b5fc71090a1a9b6e | |
parent | c8d4b96a93a4b138bf04f38e92f5e9863cc11212 (diff) | |
download | toybox-8762563eb08f690f3a11eb2b641e347c77710394.tar.gz |
find.test: allow any error message about symlink loops.
glibc says "Too many levels of symbolic links", but BSD says "Too many
symbolic links encountered". Until it becomes a problem, allow any error
message.
-rwxr-xr-x | tests/find.test | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/tests/find.test b/tests/find.test index b3f798b8..fea6a3fc 100755 --- a/tests/find.test +++ b/tests/find.test @@ -73,8 +73,6 @@ testing "-perm (any success)" \ testing "-perm (any failure)" \ "find perm -type f -perm -0222" "" "" "" -# Still fails - testing "unterminated -exec {}" \ "find dir -type f -exec ls {} 2>/dev/null || echo bad" "bad\n" "" "" testing "-exec {} +" \ @@ -105,10 +103,15 @@ testing "-printf" "find dir -name file -printf '%f %p %P %s'" \ testing "-printf .N" "find dir -name file -printf %.2f" "fi" "" "" ln -s does-not-exist dir/dangler +testing "-L dangling symlink silent" \ + "LANG=C find -L dir -name file 2>&1" "dir/file\n" "" "" +rm -f dir/dangler + ln -s looper dir/looper -testing "-L dangling link" \ - "LANG=C find -L dir -name file 2>&1 | sort | sed s/\'//g" \ - "dir/file\nfind: dir/looper: Too many levels of symbolic links\n" "" "" +testing "-L symlink loop noisy" \ + "LANG=C find -L dir -name file 2>err | sed s/\'//g ; grep -q dir/looper err || echo missing error" \ + "dir/file\n" "" "" +rm -f dir/looper err testing "-false" "find dir -false" "" "" "" testing "-true" "find dir/file -true" "dir/file\n" "" "" |