Skip to content

Commit 6ddd018

Browse files
committed
test(scp): leave comments for a failing test case
1 parent cf59417 commit 6ddd018

File tree

2 files changed

+21
-1
lines changed

2 files changed

+21
-1
lines changed

completions/ssh

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -471,6 +471,13 @@ _comp_cmd_scp__path_esc='[][(){}<>"'"'"',:;^&!$=?`\\|[:space:]]'
471471
# "compopt +o nospace" instead, but it would suffix a space to directory names
472472
# unexpectedly.
473473
#
474+
# FIXME: With the current strategy of using "ls -FL", we cannot distinguish the
475+
# filenames that end with one of the type-classifier characters. For example,
476+
# a regular file "pipe|" and a named pipe "pipe" would both produce the
477+
# identical result "pipe|" with "ls -1FL". As a consequence, those characters
478+
# at the end of the filename are removed unexpectedly. To solve this problem,
479+
# we need to give up relying on "ls -1FL".
480+
#
474481
# Options:
475482
# -d Only directory names are selected.
476483
# @param $2 escape_replacement - If a non-empty value is specified, special

test/t/test_scp.py

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -157,7 +157,13 @@ def test_xfunc_remote_files(self, bash):
157157

158158
@pytest.fixture
159159
def tmpdir_mkfifo(self, request, bash):
160-
tmpdir, _, _ = prepare_fixture_dir(request, files=[], dirs=[])
160+
# We prepare two files: 1) a named pipe and 2) a regular file ending
161+
# with the same name but an extra special character "|".
162+
tmpdir, _, _ = prepare_fixture_dir(
163+
request,
164+
files=["local_path_2-pipe|"],
165+
dirs=[],
166+
)
161167

162168
try:
163169
assert_bash_exec(bash, "mkfifo '%s/local_path_1-pipe'" % tmpdir)
@@ -174,6 +180,13 @@ def test_local_path_mark_1(self, bash, tmpdir_mkfifo):
174180
)
175181
assert completion == "pipe"
176182

183+
# FIXME: This test currently fails.
184+
# def test_local_path_mark_2(self, bash, tmpdir_mkfifo):
185+
# completion = assert_complete(
186+
# bash, "scp local_path_2-", cwd=tmpdir_mkfifo
187+
# )
188+
# assert completion == "pipe\\|"
189+
177190
@pytest.mark.complete("scp spa", cwd="scp")
178191
def test_local_path_with_spaces_1(self, completion):
179192
assert completion == r"ced\ \ conf"

0 commit comments

Comments
 (0)