Check for command with directory in PWD

Even if there is a directory in the current working directory with the
same name as a command, the directory must not be completed.

So, if we want to complete "true" and there is a directory "true" in the
current working directory, the completion list has to be just {"true"},
not {"true", "true/"}, or anything else!
This commit is contained in:
Florian Gamböck 2017-07-02 16:08:28 +02:00
parent c296a0b91d
commit 8a13f1cb75
1 changed files with 14 additions and 0 deletions

View File

@ -146,6 +146,20 @@ describe("awful.completion.shell", function()
assert.same(shell('ls l', 5, 1, 'zsh'), {'ls localcommand', 16, {'localcommand'}}) assert.same(shell('ls l', 5, 1, 'zsh'), {'ls localcommand', 16, {'localcommand'}})
end) end)
end end
if has_bash then
it("completes command regardless of local directory (bash)", function()
assert.same(shell('true', 5, 1, 'bash'), {'true', 5, {'true'}})
end)
end
if has_zsh then
it("completes command regardless of local directory (zsh)", function()
assert.same(shell('true', 5, 1, 'zsh'), {'true', 5, {'true'}})
end)
end
it("completes command regardless of local directory (nil)", function()
assert.same(shell('true', 5, 1, nil), {'true', 5, {'true'}})
end)
end) end)
describe("awful.completion.shell handles $SHELL", function() describe("awful.completion.shell handles $SHELL", function()