From 8311519e3fbb9333b7a11eb8aef956fda5fde801 Mon Sep 17 00:00:00 2001 From: rxi Date: Thu, 3 Apr 2014 20:10:08 +0100 Subject: [PATCH] Added test for lume.combine() to test_lume.lua --- test/test_lume.lua | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/test/test_lume.lua b/test/test_lume.lua index 01ec888..b3cd6ed 100644 --- a/test/test_lume.lua +++ b/test/test_lume.lua @@ -249,6 +249,16 @@ tests["lume.once"] = function() testeq( f(5), nil ) 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 tests["lume.time"] = function() local t, a, b, c = lume.time(function(x) return 50, 60, x end, 70)