@@ -24,11 +24,22 @@ def functions(self, request, bash):
2424 "_g() { local cur;_comp_get_words cur; unset -v COMPREPLY; _comp_compgen_filedir e1; }; "
2525 "complete -F _g g" ,
2626 )
27+ assert_bash_exec (
28+ bash ,
29+ "_fc() { local cur=$(_get_cword); unset -v COMPREPLY; _comp_compgen -C _filedir filedir; }; "
30+ "complete -F _fc fc; "
31+ "complete -F _fc -o filenames fc2" ,
32+ )
2733 assert_bash_exec (
2834 bash ,
2935 "_fd() { local cur;_comp_get_words cur; unset -v COMPREPLY; _comp_compgen_filedir -d; };"
3036 "complete -F _fd fd" ,
3137 )
38+ assert_bash_exec (
39+ bash ,
40+ "_fcd() { local cur=$(_get_cword); unset -v COMPREPLY; _comp_compgen -C _filedir filedir -df; };"
41+ "complete -F _fcd fcd" ,
42+ )
3243
3344 @pytest .fixture (scope = "class" )
3445 def non_windows_testdir (self , request , bash ):
@@ -68,6 +79,11 @@ def test_2(self, bash, functions, funcname):
6879 completion = assert_complete (bash , "%s ab/" % funcname , cwd = "_filedir" )
6980 assert completion == "e"
7081
82+ @pytest .mark .parametrize ("funcname" , "fc fc2" .split ())
83+ def test_2C (self , bash , functions , funcname ):
84+ completion = assert_complete (bash , "%s _filedir ab/" % funcname )
85+ assert completion == "e"
86+
7187 @pytest .mark .parametrize ("funcname" , "f f2" .split ())
7288 def test_3 (self , bash , functions , funcname ):
7389 completion = assert_complete (
@@ -156,6 +172,10 @@ def test_14(self, bash, functions, funcname):
156172 def test_15 (self , functions , completion ):
157173 assert completion == "b/"
158174
175+ @pytest .mark .complete (r"fcd a\ " )
176+ def test_15d (self , functions , completion ):
177+ assert completion == "b/"
178+
159179 @pytest .mark .complete ("g " , cwd = "_filedir/ext" )
160180 def test_16 (self , functions , completion ):
161181 assert completion == sorted ("ee.e1 foo/ gg.e1 ii.E1" .split ())
0 commit comments