From 95623d39d6029ba78ec96ad5ea08e9ac12629b91 Mon Sep 17 00:00:00 2001 From: "Gabriel F. T. Gomes" Date: Mon, 3 Aug 2020 18:43:13 -0300 Subject: New upstream version 2.11 --- test/t/unit/test_unit_expand.py | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) (limited to 'test/t/unit/test_unit_expand.py') diff --git a/test/t/unit/test_unit_expand.py b/test/t/unit/test_unit_expand.py index 7c0a9836..d2a3ebc4 100644 --- a/test/t/unit/test_unit_expand.py +++ b/test/t/unit/test_unit_expand.py @@ -3,7 +3,7 @@ import pytest from conftest import assert_bash_exec -@pytest.mark.bashcomp(cmd=None) +@pytest.mark.bashcomp(cmd=None, ignore_env=r"^[+-](cur|COMPREPLY)=") class TestUnitExpand: def test_1(self, bash): assert_bash_exec(bash, "_expand >/dev/null") @@ -11,3 +11,21 @@ class TestUnitExpand: def test_2(self, bash): """Test environment non-pollution, detected at teardown.""" assert_bash_exec(bash, "foo() { _expand; }; foo; unset 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, + 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, + want_output=True, + ) + assert output.strip() == "%s/a" % home -- cgit v1.2.1