summaryrefslogtreecommitdiff
path: root/test/lib/completions/upgradepkg.exp
diff options
context:
space:
mode:
Diffstat (limited to 'test/lib/completions/upgradepkg.exp')
-rw-r--r--test/lib/completions/upgradepkg.exp39
1 files changed, 39 insertions, 0 deletions
diff --git a/test/lib/completions/upgradepkg.exp b/test/lib/completions/upgradepkg.exp
new file mode 100644
index 00000000..860dde9e
--- /dev/null
+++ b/test/lib/completions/upgradepkg.exp
@@ -0,0 +1,39 @@
+proc setup {} {
+ save_env
+}
+
+
+proc teardown {} {
+ assert_env_unmodified {/OLDPWD=/d}
+}
+
+
+setup
+
+
+assert_complete_any "upgradepkg -"
+
+
+sync_after_int
+
+
+set test "--<TAB> should complete all long options"
+set options [list --dry-run --install-new --reinstall --verbose]
+assert_complete $options "upgradepkg --" $test
+
+
+sync_after_int
+
+
+set test "should complete *.t\[gbxl\]z files and dirs"
+set dir $::srcdir/fixtures/slackware/home
+set files [split [exec bash -c "cd $dir && find . -mindepth 1 -maxdepth 1 \
+ \\( -type d -printf '%P/\\n' \\) -o \
+ \\( -type f -name '*.t\[bglx\]z' -printf '%P\\n' \\)"] "\n"]
+assert_complete_dir $files "upgradepkg " $dir $test
+
+
+sync_after_int
+
+
+teardown