File tree Expand file tree Collapse file tree 1 file changed +10
-1
lines changed Expand file tree Collapse file tree 1 file changed +10
-1
lines changed Original file line number Diff line number Diff line change 11import pytest
22
3- from conftest import is_bash_type
3+ from conftest import is_bash_type , assert_bash_exec , bash_env_saved
44
55
66@pytest .mark .bashcomp (
@@ -76,3 +76,12 @@ def test_packages_3(self, completion):
7676 @pytest .mark .complete ("javadoc -sourcepath java/a " , env = dict (IFS = "a" ))
7777 def test_packages_4 (self , completion ):
7878 assert completion == "c"
79+
80+ def test_packages_5 (self , bash ):
81+ """_comp_cmd_java__packages should not modify the outerscope `cur`"""
82+ with bash_env_saved (bash ) as bash_env :
83+ bash_env .write_variable ("cur" , "a.b.c" )
84+ assert_bash_exec (
85+ bash ,
86+ "_comp_test_f() { local cword=3 words=(javadoc -sourcepath java/a a.b.c); COMPREPLY+=(); _comp_cmd_java__packages; }; _comp_test_f" ,
87+ )
You can’t perform that action at this time.
0 commit comments