From da987582a63ab450fad4ded7813648e2eaba3496 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Florian=20Gamb=C3=B6ck?= Date: Sat, 15 Jul 2017 17:39:30 +0200 Subject: [PATCH] Check for correct ordering of completed items The correct and consistent ordering is lexicographic. Not mtime, not ctime, but pure lexicographic ordering. --- spec/awful/completion_spec.lua | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/spec/awful/completion_spec.lua b/spec/awful/completion_spec.lua index 4c4b246e7..448f402dd 100644 --- a/spec/awful/completion_spec.lua +++ b/spec/awful/completion_spec.lua @@ -206,6 +206,20 @@ describe("awful.completion.shell", function() end) end --]] + + if has_bash then + it("correctly sorts completed items (bash)", function() + assert.same(shell('./ambi', 7, 1, 'bash'), {'./ambiguous_dir_a/', 19, + {'./ambiguous_dir_a/', './ambiguous_dir_b/', './ambiguous_dir_c/', + './ambiguous_dir_d/', './ambiguous_dir_e/', './ambiguous_dir_f/'}}) + end) + end + if has_zsh then + it("correctly sorts completed items (zsh)", function() + assert.same(shell('./ambi', 7, 1, 'zsh'), {'./ambiguous_dir_c/', 19, + {'./ambiguous_dir_c/', './ambiguous_dir_e/'}}) + end) + end end) describe("awful.completion.shell handles $SHELL", function()