mirror of
https://github.com/TangentFoxy/lume.git
synced 2025-10-02 15:22:30 +00:00
Added test for lume.combine() to test_lume.lua
This commit is contained in:
@@ -249,6 +249,16 @@ tests["lume.once"] = function()
|
|||||||
testeq( f(5), nil )
|
testeq( f(5), nil )
|
||||||
end
|
end
|
||||||
|
|
||||||
|
-- lume.combine
|
||||||
|
tests["lume.combine"] = function()
|
||||||
|
local acc = 0
|
||||||
|
local a = function(x, y) acc = acc + x + y end
|
||||||
|
local b = function(x, y) acc = acc + x * y end
|
||||||
|
local fn = lume.combine(a, b)
|
||||||
|
fn(10, 20)
|
||||||
|
testeq( acc, 230 )
|
||||||
|
end
|
||||||
|
|
||||||
-- lume.time
|
-- lume.time
|
||||||
tests["lume.time"] = function()
|
tests["lume.time"] = function()
|
||||||
local t, a, b, c = lume.time(function(x) return 50, 60, x end, 70)
|
local t, a, b, c = lume.time(function(x) return 50, 60, x end, 70)
|
||||||
|
Reference in New Issue
Block a user