Merge pull request #2539 from blueyed/test-split

tests: add basic tests for gears.string.split
This commit is contained in:
mergify[bot] 2019-01-04 22:57:27 +00:00 committed by GitHub
commit a4b9d2c1fd
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 8 additions and 0 deletions

View File

@ -41,6 +41,14 @@ describe("gears.string", function()
assert.is_true(gstring.endswith("something", "thing"))
assert.is_false(gstring.endswith("something", "that"))
end)
describe("split", function()
assert.is_same(gstring.split("", "\n"), {""})
assert.is_same(gstring.split("\n", "\n"), {"", ""})
assert.is_same(gstring.split("foo", "\n"), {"foo"})
assert.is_same(gstring.split("foo\n", "\n"), {"foo", ""})
assert.is_same(gstring.split("foo\nbar", "\n"), {"foo", "bar"})
end)
end)
-- vim: filetype=lua:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:textwidth=80