Added lume.keys() and tests, updated docs

This commit is contained in:
rxi
2014-12-12 20:37:07 +00:00
parent ac920c8f5e
commit de37bd6d65
3 changed files with 20 additions and 0 deletions

View File

@@ -274,6 +274,16 @@ tests["lume.invert"] = function()
testeq( lume.invert(lume.invert{a = 1, b = 2}), {a = 1, b = 2} )
end
-- lume.keys
tests["lume.keys"] = function()
testeq( lume.keys({}), {} )
local t = lume.keys({ aaa = 1, bbb = 2, ccc = 3 })
table.sort(t)
testeq( t, {"aaa", "bbb", "ccc"} )
local t = lume.keys({ "x", "x", "x" })
testeq( t, {1, 2, 3} )
end
-- lume.clone
tests["lume.clone"] = function()
local t = {6, 7, 4, 5}