From 2c71079ef3ebc92860e1b7aeb97293a870c4c3ab Mon Sep 17 00:00:00 2001 From: rxi Date: Sat, 8 Mar 2014 14:45:18 +0000 Subject: [PATCH] Added tests for lume.invert() --- test/test_lume.lua | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/test/test_lume.lua b/test/test_lume.lua index 5ad6661..3c29f4f 100644 --- a/test/test_lume.lua +++ b/test/test_lume.lua @@ -160,6 +160,14 @@ tests["lume.reduce"] = function() testeq( lume.reduce({}, concat, "potato"), "potato" ) end +-- lume.invert +tests["lume_invert"] = function() + testeq( {}, {} ) + testeq( lume.invert{a = "x", b = "y"}, {x = "a", y = "b"} ) + testeq( lume.invert{a = 1, b = 2}, {"a", "b"} ) + testeq( lume.invert(lume.invert{a = 1, b = 2}), {a = 1, b = 2} ) +end + -- lume.set tests["lume.set"] = function() local t = lume.set({1, 2, 3, 2, 5, 6, 6})