3 [ -f testing.sh ] && . testing.sh
12 #testing "name" "command" "result" "infile" "stdin"
16 testing "find -type l -a -type d -o -type p" \
17 "find dir -type l -a -type d -o -type p" "dir/fifo\n" "" ""
18 testing "find -type l -type d -o -type p" "find dir -type l -type d -o -type p" \
20 testing "find -type l -o -type d -a -type p" \
21 "find dir -type l -o -type d -a -type p" "dir/link\n" "" ""
22 testing "find -type l -o -type d -type p" "find dir -type l -o -type d -type p" \
24 testing "find -type l ( -type d -o -type l )" \
25 "find dir -type l \( -type d -o -type l \)" "dir/link\n" "" ""
26 testing "find extra parantheses" \
27 "find dir \( \( -type l \) \( -type d -o \( \( -type l \) \) \) \)" \
29 testing "find ( -type p -o -type d ) -type p" \
30 "find dir \( -type p -o -type d \) -type p" "dir/fifo\n" "" ""
31 testing "find -type l -o -type d -type p -o -type f" \
32 "find dir -type l -o -type d -type p -o -type f | sort" \
33 "dir/file\ndir/link\n" "" ""
35 # Testing short-circuit evaluations
37 testing "find -type f -a -print" \
38 "find dir -type f -a -print" "dir/file\n" "" ""
39 testing "find -print -o -print" \
40 "find dir -type f -a \( -print -o -print \)" "dir/file\n" "" ""