Added function lume.extend(), updated README and tests

This commit is contained in:
rxi
2015-05-05 19:21:56 +01:00
parent fce4a5e5df
commit 2e00c753d8
3 changed files with 32 additions and 0 deletions

View File

@@ -145,6 +145,16 @@ tests["lume.clear"] = function()
testeq( lume.clear(t) == t, true )
end
-- lume.extend
tests["lume.extend"] = function()
local t = { a = 10, b = 20, c = 30 }
testeq( lume.extend(t) == t, true )
lume.extend(t, { d = 40 }, { e = 50 })
testeq( t, { a = 10, b = 20, c = 30, d = 40, e = 50 } )
lume.extend(t, { a = "cat", b = "dog" }, { b = "owl", c = "fox" })
testeq( t, { a = "cat", b = "owl", c = "fox", d = 40, e = 50 } )
end
-- lume.shuffle
tests["lume.shuffle"] = function()
local t = {1, 2, 3, 4, 5}