Skip to content

Commit

Permalink
test/_known_hosts_real: add explicit no globbing test case
Browse files Browse the repository at this point in the history
  • Loading branch information
scop committed Jun 27, 2020
1 parent f7c14b5 commit 8200b9a
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 0 deletions.
Empty file.
18 changes: 18 additions & 0 deletions test/t/unit/test_unit_known_hosts_real.py
Original file line number Diff line number Diff line change
Expand Up @@ -134,3 +134,21 @@ def test_included_configs(self, bash, hosts):
)
assert_bash_exec(bash, 'HOME="$OLDHOME"')
assert sorted(set(output.strip().split())) == sorted(expected)

def test_no_globbing(self, bash):
assert_bash_exec(
bash, 'OLDHOME="$HOME"; HOME="%s/_known_hosts_real"' % bash.cwd
)
output = assert_bash_exec(
bash,
"cd _known_hosts_real; "
"unset -v COMPREPLY COMP_KNOWN_HOSTS_WITH_HOSTFILE; "
"_known_hosts_real -aF config ''; "
r'printf "%s\n" "${COMPREPLY[@]}"; '
"cd - &>/dev/null",
want_output=True,
)
assert_bash_exec(bash, 'HOME="$OLDHOME"')
completion = sorted(set(output.strip().split()))
assert "gee" in completion
assert "gee-filename-canary" not in completion

0 comments on commit 8200b9a

Please sign in to comment.