Added lume.concat(), updated README and tests

This commit is contained in:
rxi
2015-01-10 17:13:15 +00:00
parent ce86f4b0ea
commit 397dce4c5e
3 changed files with 27 additions and 0 deletions

View File

@@ -220,6 +220,14 @@ tests["lume.merge"] = function()
testeq( lume.merge({a=1, b=2}, {b=3, c=4}, true), {a=1, b=3, c=4} )
end
-- lume.concat
tests["lume.concat"] = function()
testeq( lume.concat(nil), {} )
testeq( lume.concat({1, 2, 3}), {1, 2, 3} )
testeq( lume.concat({1, 2, 3}, {4, 5, 6}), {1, 2, 3, 4, 5, 6} )
testeq( lume.concat({1, 2, 3}, {4, 5, 6}, nil, {7}), {1, 2, 3, 4, 5, 6, 7} )
end
-- lume.find
tests["lume.find"] = function()
testeq( lume.find({"a", "b", "c"}, "b"), 2 )