awesome/tests/examples/text/gears/string/endswith.lua

16 lines
374 B
Lua
Raw Normal View History

2019-12-13 21:19:38 +01:00
--DOC_GEN_OUTPUT --DOC_HIDE
local gears = require("gears") --DOC_HIDE
local test = "do.it"
local res = gears.string.endswith(test,"it")
print(tostring(res))
assert(res == true) --DOC_HIDE
res = gears.string.endswith(test,"do")
print(tostring(res))
assert(res == false) --DOC_HIDE
2021-01-27 01:41:08 +01:00
res = gears.string.endswith(nil,"it")
print(tostring(res))
assert(res == false) --DOC_HIDE