Check for not completing lone directories

Even if there is a sole directory with the name of the current
completion item, if it does not start with `./` then do not complete it!
This commit is contained in:
Florian Gamböck 2017-07-10 20:48:17 +02:00
parent 51e5381b67
commit 7ab57e1953
1 changed files with 11 additions and 0 deletions

View File

@ -182,6 +182,17 @@ describe("awful.completion.shell", function()
assert.same(shell('true', 5, 1, nil), {'true', 5, {'true'}}) assert.same(shell('true', 5, 1, nil), {'true', 5, {'true'}})
end) end)
if has_bash then
it("does not complete local directory not starting with ./ (bash)", function()
assert.same(shell('just_a', 7, 1, 'bash'), {'just_a', 7})
end)
end
if has_zsh then
it("does not complete local directory not starting with ./ (zsh)", function()
assert.same(shell('just_a', 7, 1, 'zsh'), {'just_a', 7})
end)
end
if has_bash then if has_bash then
it("completes local directories starting with ./ (bash)", function() it("completes local directories starting with ./ (bash)", function()
assert.same(shell('./just', 7, 1, 'bash'), {'./just_a_directory/', 20, {'./just_a_directory/'}}) assert.same(shell('./just', 7, 1, 'bash'), {'./just_a_directory/', 20, {'./just_a_directory/'}})