From 098754056ade5d37a45ae14b02936d5c8d03427d Mon Sep 17 00:00:00 2001 From: rxi Date: Sat, 5 Apr 2014 16:35:53 +0100 Subject: [PATCH] Added tests for lume.chain() --- test/test_lume.lua | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/test/test_lume.lua b/test/test_lume.lua index 97cac16..ea1694e 100644 --- a/test/test_lume.lua +++ b/test/test_lume.lua @@ -393,6 +393,13 @@ tests["lume.rgba"] = function() testeq( b, 0x78 ) end +-- lume.chain +tests["lume.chain"] = function() + local t = lume.chain({1, 2}):map(function(x) return x * 2 end):result() + testeq( t, { 2, 4 } ) + testeq( lume.chain(10):result(), 10 ) +end + tester.dotests(tests) tester.test.global()