Skip to content

Commit 88894da

Browse files
committed
test(_filedir): Test files that start with ".."
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
1 parent eaa9bca commit 88894da

File tree

4 files changed

+14
-0
lines changed

4 files changed

+14
-0
lines changed

test/fixtures/_filedir/dotdot/..2016_02_01_15_04_05.123456

Whitespace-only changes.

test/fixtures/_filedir/dotdot/..data

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
..2016_02_01_15_04_05.123456

test/fixtures/_filedir/dotdot/..folder/.nothing_here

Whitespace-only changes.

test/t/unit/test_unit_compgen_filedir.py

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -259,3 +259,16 @@ def test_28_dot_4(self, bash, functions, funcname):
259259
"""Include . when the completion is attempted for '..[TAB]'"""
260260
completion = assert_complete(bash, r"%s _filedir/.." % funcname)
261261
assert completion == "/"
262+
263+
@pytest.mark.parametrize("funcname", "f f2".split())
264+
def test_29_dotdot(self, bash, functions, funcname):
265+
"""Complete files starting with .."""
266+
completion = assert_complete(
267+
bash, r"%s .." % funcname, cwd="_filedir/dotdot/"
268+
)
269+
assert completion == [
270+
"../",
271+
"..2016_02_01_15_04_05.123456",
272+
"..data",
273+
"..folder/",
274+
]

0 commit comments

Comments
 (0)