From 828d23e6f65b87e9487896621ac3dc1e19f3a8e4 Mon Sep 17 00:00:00 2001 From: rxi Date: Wed, 19 Mar 2014 12:53:01 +0000 Subject: [PATCH] Added new tests and updated some others for lume.split() --- test/test_lume.lua | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/test/test_lume.lua b/test/test_lume.lua index c965c9b..05bcef5 100644 --- a/test/test_lume.lua +++ b/test/test_lume.lua @@ -280,9 +280,15 @@ end -- lume.split tests["lume.split"] = function() - testeq( lume.split("cat dog pig"), {"cat", "dog", "pig"} ) - testeq( lume.split(",cat,dog,pig", ","), {"cat", "dog", "pig"} ) - testeq( lume.split(",cat,dog;pig", ",;"), {"cat", "dog", "pig"} ) + testeq( lume.split("cat dog pig"), {"cat", "dog", "pig"} ) + testeq( lume.split("cat,dog,pig", ","), {"cat", "dog", "pig"} ) + testeq( lume.split("cat,dog;pig", ";"), {"cat,dog", "pig"} ) + testeq( lume.split("cat,dog,,pig", ","), {"cat", "dog", "", "pig"} ) + testeq( lume.split(";;;cat;", ";"), {"", "", "", "cat", ""} ) + testeq( lume.split("cat.dog", "."), {"cat", "dog"} ) + testeq( lume.split("cat%dog", "%"), {"cat", "dog"} ) + testeq( lume.split("1<>2<>3", "<>"), {"1", "2", "3"} ) + tester.test.error( lume.split, "abc", "" ) end -- lume.trim