3 # Copyright 2014 by Denys Vlasenko <vda.linux@googlemail.com>
4 # Licensed under GPLv2, see file LICENSE in this source tree.
8 # testing "description" "command" "result" "infile" "stdin"
11 touch find.tempdir/testfile
13 optional FEATURE_FIND_TYPE
14 testing "find -type f" \
15 "cd find.tempdir && find -type f 2>&1" \
19 optional FEATURE_FIND_EXEC
20 testing "find -exec exitcode 1" \
21 "cd find.tempdir && find testfile -exec true {} \; 2>&1; echo \$?" \
25 optional FEATURE_FIND_EXEC_PLUS
26 testing "find -exec exitcode 2" \
27 "cd find.tempdir && find testfile -exec true {} + 2>&1; echo \$?" \
31 # Surprisingly, "-exec false ;" results in exitcode 0! "-exec false +" is different!!!
32 optional FEATURE_FIND_EXEC
33 testing "find -exec exitcode 3" \
34 "cd find.tempdir && find testfile -exec false {} \; 2>&1; echo \$?" \
38 optional FEATURE_FIND_EXEC_PLUS
39 testing "find -exec exitcode 4" \
40 "cd find.tempdir && find testfile -exec false {} + 2>&1; echo \$?" \
44 optional FEATURE_FIND_MAXDEPTH
45 testing "find / -maxdepth 0 -name /" \
46 "find / -maxdepth 0 -name /" \
49 testing "find // -maxdepth 0 -name /" \
50 "find // -maxdepth 0 -name /" \
53 testing "find / -maxdepth 0 -name //" \
54 "find / -maxdepth 0 -name //" \
57 testing "find // -maxdepth 0 -name //" \
58 "find // -maxdepth 0 -name //" \
63 testing "find ./// -name ." \
67 testing "find ./// -name .///" \
68 "find ./// -name .///" \
72 # testing "description" "command" "result" "infile" "stdin"