summaryrefslogtreecommitdiff
path: root/test/lib/completions/find.exp
diff options
context:
space:
mode:
Diffstat (limited to 'test/lib/completions/find.exp')
-rw-r--r--test/lib/completions/find.exp80
1 files changed, 80 insertions, 0 deletions
diff --git a/test/lib/completions/find.exp b/test/lib/completions/find.exp
new file mode 100644
index 00000000..4b1728dc
--- /dev/null
+++ b/test/lib/completions/find.exp
@@ -0,0 +1,80 @@
+proc setup {} {
+ save_env
+}; # setup()
+
+
+proc teardown {} {
+ assert_env_unmodified {/OLDPWD=/d}
+}; # teardown()
+
+
+setup
+
+
+assert_complete_any "find "
+
+
+sync_after_int
+
+
+assert_complete_any "find -fstype "
+
+
+sync_after_int
+
+
+set options [list -daystart -depth -follow -help \
+ -ignore_readdir_race -maxdepth -mindepth -mindepth -mount \
+ -noignore_readdir_race -noleaf -regextype -version -warn -nowarn \
+ -xdev \
+ -amin -anewer -atime -cmin -cnewer -ctime -empty -executable -false \
+ -fstype -gid -group -ilname -iname -inum -ipath -iregex -iwholename \
+ -links -lname -mmin -mtime -name -newer -nogroup -nouser -path -perm \
+ -readable -regex -samefile -size -true -type -uid -used -user \
+ -wholename -writable -xtype -context \
+ -delete -exec -execdir -fls -fprint -fprint0 -fprintf -ls -ok -okdir \
+ -print -print0 -printf -prune -quit]
+assert_complete $options {find -}
+
+
+sync_after_int
+
+
+set test "-wholename should complete files/dirs"
+set dir fixtures/shared/default
+set files [split [exec bash -c "cd $dir && ls -p"] "\n"]
+assert_complete_dir $files "find -wholename " $dir
+
+
+sync_after_int
+
+
+set test "-uid should complete uids"
+ # Complete
+set cmd "find -uid "
+send "$cmd\t"
+expect {
+ -re "$cmd\r\n\\d+.*/@$cmd$" { pass "$test" }
+ -re /@ { unresolved "$test at prompt" }
+ -re eof { unresolved "eof" }
+}; # expect
+
+
+sync_after_int
+
+
+set test "-gid should complete gids"
+ # Complete
+set cmd "find -gid "
+send "$cmd\t"
+expect {
+ -re "$cmd\r\n\\d+.*/@$cmd$" { pass "$test" }
+ -re /@ { unresolved "$test at prompt" }
+ -re eof { unresolved "eof" }
+}; # expect
+
+
+sync_after_int
+
+
+teardown