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 1
1
import pytest
2
2
3
- from conftest import is_bash_type
3
+ from conftest import is_bash_type , assert_bash_exec , bash_env_saved
4
4
5
5
6
6
@pytest .mark .bashcomp (
@@ -76,3 +76,12 @@ def test_packages_3(self, completion):
76
76
@pytest .mark .complete ("javadoc -sourcepath java/a " , env = dict (IFS = "a" ))
77
77
def test_packages_4 (self , completion ):
78
78
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