mirror of
https://github.com/TangentFoxy/lume.git
synced 2024-11-19 07:04:24 +00:00
Added new tests and updated some others for lume.split()
This commit is contained in:
parent
13a8edb2e7
commit
828d23e6f6
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user