diff --git a/test/test_lume.lua b/test/test_lume.lua index 7c5c85f..5ad6661 100644 --- a/test/test_lume.lua +++ b/test/test_lume.lua @@ -150,8 +150,14 @@ end -- lume.reduce tests["lume.reduce"] = function() local concat = function(a, b) return a .. b end + local add = function(a, b) return a + b end testeq( lume.reduce({"cat", "dog"}, concat, ""), "catdog" ) testeq( lume.reduce({"cat", "dog"}, concat, "pig"), "pigcatdog" ) + testeq( lume.reduce({"me", "ow"}, concat), "meow" ) + testeq( lume.reduce({1, 2, 3, 4}, add), 10 ) + testeq( lume.reduce({1, 2, 3, 4}, add), 10 ) + testeq( lume.reduce({1}, add), 1 ) + testeq( lume.reduce({}, concat, "potato"), "potato" ) end -- lume.set