Add tests for gears.string.startswith and endswith

Signed-off-by: Uli Schlachter <uli.schlachter@informatik.uni-oldenburg.de>
This commit is contained in:
Uli Schlachter 2017-08-21 09:05:37 +02:00
parent 5d0e9fd9e3
commit e7bf8de081

View file

@ -29,4 +29,18 @@ describe("gears.string", function()
assert.is.equal(string.match("DownLow", gstring.query_to_pattern("ownl")), "ownL")
end)
end)
describe("startswith", function()
assert.is_true(gstring.startswith("something", ""))
assert.is_true(gstring.startswith("something", "some"))
assert.is_false(gstring.startswith("something", "none"))
end)
describe("endswith", function()
assert.is_true(gstring.endswith("something", ""))
assert.is_true(gstring.endswith("something", "thing"))
assert.is_false(gstring.endswith("something", "that"))
end)
end)
-- vim: filetype=lua:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:textwidth=80