summaryrefslogtreecommitdiff
path: root/test/t/unit/test_unit_expand_tilde_by_ref.py
blob: fbc172df3f77e335f6764eb31d8c2ac95a233664 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
import pytest

from conftest import assert_bash_exec


@pytest.mark.bashcomp(cmd=None)
class TestUnitExpandTildeByRef:
    def test_1(self, bash):
        assert_bash_exec(bash, "__expand_tilde_by_ref >/dev/null")

    def test_2(self, bash):
        """Test environment non-pollution, detected at teardown."""
        assert_bash_exec(
            bash,
            '_x() { local aa="~"; __expand_tilde_by_ref aa; }; _x; unset _x',
        )