Add tests for gears.string.startswith and endswith
Signed-off-by: Uli Schlachter <uli.schlachter@informatik.uni-oldenburg.de>
This commit is contained in:
parent
5d0e9fd9e3
commit
e7bf8de081
|
@ -29,4 +29,18 @@ describe("gears.string", function()
|
||||||
assert.is.equal(string.match("DownLow", gstring.query_to_pattern("ownl")), "ownL")
|
assert.is.equal(string.match("DownLow", gstring.query_to_pattern("ownl")), "ownL")
|
||||||
end)
|
end)
|
||||||
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)
|
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
|
||||||
|
|
Loading…
Reference in New Issue