summaryrefslogtreecommitdiff
path: root/test/unit/_filedir.exp
diff options
context:
space:
mode:
Diffstat (limited to 'test/unit/_filedir.exp')
-rw-r--r--test/unit/_filedir.exp124
1 files changed, 0 insertions, 124 deletions
diff --git a/test/unit/_filedir.exp b/test/unit/_filedir.exp
deleted file mode 100644
index 1de49504..00000000
--- a/test/unit/_filedir.exp
+++ /dev/null
@@ -1,124 +0,0 @@
-proc setup {} {
- assert_bash_exec {unset COMPREPLY cur}
- assert_bash_exec {unset -f _f}
- save_env
- # Declare bash completion function `_f'
- assert_bash_exec { \
- _f() { local cur=$(_get_cword); unset COMPREPLY; _filedir; }; \
- complete -F _f f \
- }
- # Declare bash completion function `_f2' with `-o filenames' active.
- assert_bash_exec { \
- complete -F _f -o filenames f2 \
- }
- # Create directories `a"b', `a*b', and `a\b' only when not running on
- # Cygwin/Windows (`"', `*', or `\' aren't allowed in filenames there)
- if {! [is_cygwin]} {
- # Create directory `a"b'
- assert_bash_exec {(cd $TESTDIR/tmp && [ ! -d a\"b ] && mkdir a\"b && touch a\"b/d || true)}
- # Create directory `a*b'
- assert_bash_exec {(cd $TESTDIR/tmp && [ ! -d a\*b ] && mkdir a\*b && touch a\*b/j || true)}
- # Create directory `a\b'
- assert_bash_exec {(cd $TESTDIR/tmp && [ ! -d a\\b ] && mkdir a\\b && touch a\\b/g || true)}
- }
-}
-
-
-proc teardown {} {
- if {! [is_cygwin]} {
- assert_bash_exec {(cd $TESTDIR/tmp && rm -- a\"b/d && rmdir a\"b/ || true)}
- assert_bash_exec {(cd $TESTDIR/tmp && rm -- a\\b/g && rmdir a\\b/ || true)}
- assert_bash_exec {(cd $TESTDIR/tmp && rm -- a\*b/j && rmdir a\*b/ || true)}
- }
- assert_bash_exec {unset COMPREPLY cur}
- assert_bash_exec {unset -f _f}
- assert_bash_exec {complete -r f}
- assert_env_unmodified {
- /OLDPWD/d
- /OLD_CTYPE/d
- }
-}
-
-
-setup
-
-
-foreach name {f f2} {
-
- set test "completing $name a\\\$b/ should return h"
- if {[info exists ::env(CI)] && [info exists ::env(DIST)] && $::env(DIST) == "centos6"} {
- xfail $test
- } else {
- set cmd "$name a\\\$b/"
- assert_complete_dir h $cmd "$::srcdir/fixtures/_filedir" $test
- sync_after_int
- }
-
- if {! [is_cygwin]} { # Illegal characters in file/dir names
- set test "completing $name a\\\"b/ should return d"; #"
- set cmd "$name a\\\"b/"; #"
- assert_complete_dir d $cmd "$TESTDIR/tmp" $test
- sync_after_int
-
- set test "completing $name a\\\\b/ should return g"
- set cmd "$name a\\\\b/"
- assert_complete_dir g $cmd "$TESTDIR/tmp" $test
- sync_after_int
- }
-
- if {! [is_cygwin]} { # Illegal characters in file/dir names
- set cmd "$name 'a\"b/"; #"
- assert_complete_dir {d'} $cmd "$TESTDIR/tmp"
- sync_after_int
-
- set cmd "$name '$TESTDIR/tmp/a\\b/"
- assert_complete_dir {g'} $cmd "$TESTDIR/tmp"
- sync_after_int
- }
-
- if {! [is_cygwin]} { # Illegal characters in file/dir names
- set cmd "$name \"a\\\"b/"; #"
- assert_complete_dir {d"} $cmd "$TESTDIR/tmp"; #"
- sync_after_int
- }
-
- if {[info exists ::env(CI)] && [info exists ::env(DIST)] && $::env(DIST) == "centos6"} {
- xfail "$name \"a\\\$b/ should show completions"
- } else {
- set cmd "$name \"a\\\$b/"; #"
- assert_complete_dir {h"} $cmd "$::srcdir/fixtures/_filedir"; #"
- sync_after_int
- }
-
- set cmd "$name \"a\\b/"; #"
- assert_complete_dir "\b\b\bb/e\\\"" $cmd "$::srcdir/fixtures/_filedir"
- sync_after_int
-
- set cmd "$name \"a\\\\b/"; #"
- assert_complete_dir {g"} $cmd "$TESTDIR/tmp"; #"
- sync_after_int
-
- set cmd "$name \\\[x"
- assert_complete_dir {\[x\]} $cmd "$::srcdir/fixtures/_filedir/brackets"
- sync_after_int
-
-}; # foreach
-
-set test "completing f aé should return g"
-# Execute this test only with LC_CTYPE matching *UTF-8*
-# See also: http://www.mail-archive.com/bash-completion-devel\
-# @lists.alioth.debian.org/msg02265.html
-# Don't execute this test on expect-5.44 cause it will segfault
-# See also: Alioth #312792
-if {
- [string first "UTF-8" $::LC_CTYPE] != -1 &&
- [string first 5.44 [exp_version]] != 0
-} {
- assert_complete_dir g "f aé/" "$::srcdir/fixtures/_filedir"
-} else {
- unsupported "$test"
-}
-sync_after_int
-
-
-teardown