Skip to content

Commit 0780cb0

Browse files
committed
test(scp): leave comments for a failing test case
1 parent 397abf9 commit 0780cb0

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
@@ -183,7 +183,13 @@ def test_remote_path_ending_with_backslash(self, bash):
183183

184184
@pytest.fixture
185185
def tmpdir_mkfifo(self, request, bash):
186-
tmpdir, _, _ = prepare_fixture_dir(request, files=[], dirs=[])
186+
# We prepare two files: 1) a named pipe and 2) a regular file ending
187+
# with the same name but an extra special character "|".
188+
tmpdir, _, _ = prepare_fixture_dir(
189+
request,
190+
files=["local_path_2-pipe|"],
191+
dirs=[],
192+
)
187193

188194
# If the system allows creating a named pipe, we create it in a
189195
# temporary directory and returns the path. We cannot check the
@@ -206,6 +212,13 @@ def test_local_path_mark_1(self, bash, tmpdir_mkfifo):
206212
)
207213
assert completion == "pipe"
208214

215+
# FIXME: This test currently fails.
216+
# def test_local_path_mark_2(self, bash, tmpdir_mkfifo):
217+
# completion = assert_complete(
218+
# bash, "scp local_path_2-", cwd=tmpdir_mkfifo
219+
# )
220+
# assert completion == "pipe\\|"
221+
209222
@pytest.mark.complete("scp spa", cwd="scp")
210223
def test_local_path_with_spaces_1(self, completion):
211224
assert completion == r"ced\ \ conf"

0 commit comments

Comments
 (0)