From c971cee7530e8ba9f628f47dbe19ccd726a594cb Mon Sep 17 00:00:00 2001 From: rxi Date: Thu, 13 Mar 2014 21:41:15 +0000 Subject: [PATCH] Added more tests for lume.slice() --- test/test_lume.lua | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) diff --git a/test/test_lume.lua b/test/test_lume.lua index d8519e6..d6c6b27 100644 --- a/test/test_lume.lua +++ b/test/test_lume.lua @@ -203,13 +203,18 @@ end -- lume.slice tests["lume.slice"] = function() - testeq( lume.slice({"a", "b", "c", "d", "e"}, 2, 4), {"b", "c", "d"} ) - testeq( lume.slice({"a", "b", "c", "d", "e"}, 2, -2), {"b", "c", "d"} ) - testeq( lume.slice({"a", "b", "c", "d", "e"}, 3, -1), {"c", "d", "e"} ) - testeq( lume.slice({"a", "b", "c", "d", "e"}, 3), {"c", "d", "e"} ) - testeq( lume.slice({"a", "b", "c", "d", "e"}, 4), {"d", "e"} ) - testeq( lume.slice({"a", "b", "c", "d", "e"}, 1, 1), {"a"} ) - testeq( lume.slice({"a", "b", "c", "d", "e"}, 2, 1), {} ) + testeq( lume.slice({"a", "b", "c", "d", "e"}, 2, 4), {"b", "c", "d"} ) + testeq( lume.slice({"a", "b", "c", "d", "e"}, 2, -2), {"b", "c", "d"} ) + testeq( lume.slice({"a", "b", "c", "d", "e"}, 3, -1), {"c", "d", "e"} ) + testeq( lume.slice({"a", "b", "c", "d", "e"}, 3), {"c", "d", "e"} ) + testeq( lume.slice({"a", "b", "c", "d", "e"}, 4), {"d", "e"} ) + testeq( lume.slice({"a", "b", "c", "d", "e"}, 1, 1), {"a"} ) + testeq( lume.slice({"a", "b", "c", "d", "e"}, 2, 1), {} ) + testeq( lume.slice({"a", "b", "c", "d", "e"}, -3, -2), {"c", "d"} ) + testeq( lume.slice({"a", "b", "c", "d", "e"}, -3, 1), {} ) + testeq( lume.slice({"a", "b", "c", "d", "e"}, 0, 1), {"a"} ) + testeq( lume.slice({"a", "b", "c", "d", "e"}, 0, 0), {} ) + testeq( lume.slice({"a", "b", "c", "d", "e"}, -3), {"c", "d", "e"} ) end -- lume.invert