diff --git a/lib/awful/util.lua b/lib/awful/util.lua index dddcafe7..1d817406 100644 --- a/lib/awful/util.lua +++ b/lib/awful/util.lua @@ -385,7 +385,7 @@ function util.linecount(text) return gstring.linecount(text) end ---- Get a sorted table with all integer keys from a table +--- Get a sorted table with all keys from a table. -- @deprecated util.table.keys -- @param t the table for which the keys to get -- @return A table with keys diff --git a/lib/gears/table.lua b/lib/gears/table.lua index a06738aa..118971c2 100644 --- a/lib/gears/table.lua +++ b/lib/gears/table.lua @@ -149,7 +149,7 @@ function gtable.find_first_key(t, matcher, ordered) end ---- Get a sorted table with all integer keys from a table. +--- Get a sorted table with all keys from a table. -- -- @tparam table t The table for which the keys to get. -- @treturn table A table with keys. diff --git a/spec/gears/table_spec.lua b/spec/gears/table_spec.lua index e4000c2b..dbe836a8 100644 --- a/spec/gears/table_spec.lua +++ b/spec/gears/table_spec.lua @@ -2,6 +2,11 @@ local gtable = require("gears.table") describe("gears.table", function() + it("table.keys", function() + local t = { 1, a = 2, 3 } + assert.is.same(gtable.keys(t), { 1, 2, "a" }) + end) + it("table.keys_filter", function() local t = { "a", 1, function() end, false} assert.is.same(gtable.keys_filter(t, "number", "function"), { 2, 3 })