fix(doc): gears.table.keys: s/integer keys/integer/ (#3293)
This commit is contained in:
parent
80a7d9e3ee
commit
dab84c2662
|
@ -385,7 +385,7 @@ function util.linecount(text)
|
||||||
return gstring.linecount(text)
|
return gstring.linecount(text)
|
||||||
end
|
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
|
-- @deprecated util.table.keys
|
||||||
-- @param t the table for which the keys to get
|
-- @param t the table for which the keys to get
|
||||||
-- @return A table with keys
|
-- @return A table with keys
|
||||||
|
|
|
@ -149,7 +149,7 @@ function gtable.find_first_key(t, matcher, ordered)
|
||||||
end
|
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.
|
-- @tparam table t The table for which the keys to get.
|
||||||
-- @treturn table A table with keys.
|
-- @treturn table A table with keys.
|
||||||
|
|
|
@ -2,6 +2,11 @@
|
||||||
local gtable = require("gears.table")
|
local gtable = require("gears.table")
|
||||||
|
|
||||||
describe("gears.table", function()
|
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()
|
it("table.keys_filter", function()
|
||||||
local t = { "a", 1, function() end, false}
|
local t = { "a", 1, function() end, false}
|
||||||
assert.is.same(gtable.keys_filter(t, "number", "function"), { 2, 3 })
|
assert.is.same(gtable.keys_filter(t, "number", "function"), { 2, 3 })
|
||||||
|
|
Loading…
Reference in New Issue