Skip to content

Commit

Permalink
test(_filedir): Test files that start with ".."
Browse files Browse the repository at this point in the history
These types of files are used by the go kubernetes atomic writer [0],
and presumably other types of systems, and we want to make sure they
will be completed correctly.

[0] https://pkg.go.dev/k8s.io/kubernetes/pkg/volume/util#AtomicWriter.Write
  • Loading branch information
yedayak committed Nov 1, 2024
1 parent eaa9bca commit 88894da
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 0 deletions.
Empty file.
1 change: 1 addition & 0 deletions test/fixtures/_filedir/dotdot/..data
Empty file.
13 changes: 13 additions & 0 deletions test/t/unit/test_unit_compgen_filedir.py
Original file line number Diff line number Diff line change
Expand Up @@ -259,3 +259,16 @@ def test_28_dot_4(self, bash, functions, funcname):
"""Include . when the completion is attempted for '..[TAB]'"""
completion = assert_complete(bash, r"%s _filedir/.." % funcname)
assert completion == "/"

@pytest.mark.parametrize("funcname", "f f2".split())
def test_29_dotdot(self, bash, functions, funcname):
"""Complete files starting with .."""
completion = assert_complete(
bash, r"%s .." % funcname, cwd="_filedir/dotdot/"
)
assert completion == [
"../",
"..2016_02_01_15_04_05.123456",
"..data",
"..folder/",
]

0 comments on commit 88894da

Please sign in to comment.