diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-05-04 01:03:19 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-05-04 01:03:19 +0000 |
commit | 6c09f2a45c5541e9c207d14fc7aa21a4a0066bde (patch) | |
tree | 0221189d367bf661f6f9493c4f17a03f0dd4b7d2 /test/t/unit/test_unit_expand.py | |
parent | Releasing progress-linux version 1:2.11-8~progress7.99u1. (diff) | |
download | bash-completion-6c09f2a45c5541e9c207d14fc7aa21a4a0066bde.tar.xz bash-completion-6c09f2a45c5541e9c207d14fc7aa21a4a0066bde.zip |
Merging upstream version 1:2.12.0.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'test/t/unit/test_unit_expand.py')
-rw-r--r-- | test/t/unit/test_unit_expand.py | 21 |
1 files changed, 16 insertions, 5 deletions
diff --git a/test/t/unit/test_unit_expand.py b/test/t/unit/test_unit_expand.py index d2a3ebc..0be6c52 100644 --- a/test/t/unit/test_unit_expand.py +++ b/test/t/unit/test_unit_expand.py @@ -1,31 +1,42 @@ import pytest -from conftest import assert_bash_exec +from conftest import assert_bash_exec, bash_env_saved @pytest.mark.bashcomp(cmd=None, ignore_env=r"^[+-](cur|COMPREPLY)=") class TestUnitExpand: def test_1(self, bash): - assert_bash_exec(bash, "_expand >/dev/null") + assert_bash_exec(bash, "_comp_expand >/dev/null") def test_2(self, bash): """Test environment non-pollution, detected at teardown.""" - assert_bash_exec(bash, "foo() { _expand; }; foo; unset foo") + assert_bash_exec(bash, "foo() { _comp_expand; }; foo; unset -f foo") def test_user_home_compreply(self, bash, user_home): user, home = user_home output = assert_bash_exec( bash, - r'cur="~%s"; _expand; printf "%%s\n" "$COMPREPLY"' % user, + r'cur="~%s"; _comp_expand; printf "%%s\n" "$COMPREPLY"' % user, want_output=True, ) assert output.strip() == home + def test_user_home_compreply_failglob(self, bash, user_home): + user, home = user_home + with bash_env_saved(bash) as bash_env: + bash_env.shopt("failglob", True) + output = assert_bash_exec( + bash, + r'cur="~%s"; _comp_expand; printf "%%s\n" "$COMPREPLY"' % user, + want_output=True, + ) + assert output.strip() == home + def test_user_home_cur(self, bash, user_home): user, home = user_home output = assert_bash_exec( bash, - r'cur="~%s/a"; _expand; printf "%%s\n" "$cur"' % user, + r'cur="~%s/a"; _comp_expand; printf "%%s\n" "$cur"' % user, want_output=True, ) assert output.strip() == "%s/a" % home |