mirror of
https://github.com/sbrl/Minetest-WorldEditAdditions.git
synced 2024-11-21 23:13:00 +00:00
tests/str_starts: fix assert calls
This commit is contained in:
parent
4597edcf1e
commit
70d6f36444
1 changed files with 12 additions and 12 deletions
|
@ -3,38 +3,38 @@ local polyfill = require("worldeditadditions.utils.strings.polyfill")
|
|||
describe("str_starts", function()
|
||||
it("should return true for a single character", function()
|
||||
assert.are.equal(
|
||||
polyfill.str_starts("test", "t"),
|
||||
true
|
||||
true,
|
||||
polyfill.str_starts("test", "t")
|
||||
)
|
||||
end)
|
||||
it("should return true for a multiple characters", function()
|
||||
assert.are.equal(
|
||||
polyfill.str_starts("test", "te"),
|
||||
true
|
||||
true,
|
||||
polyfill.str_starts("test", "te")
|
||||
)
|
||||
end)
|
||||
it("should return true for identical strings", function()
|
||||
assert.are.equal(
|
||||
polyfill.str_starts("test", "test"),
|
||||
true
|
||||
true,
|
||||
polyfill.str_starts("test", "test")
|
||||
)
|
||||
end)
|
||||
it("should return false for a single character ", function()
|
||||
assert.are.equal(
|
||||
polyfill.str_starts("test", "y"),
|
||||
false
|
||||
false,
|
||||
polyfill.str_starts("test", "y")
|
||||
)
|
||||
end)
|
||||
it("should return false for a character present elsewherer", function()
|
||||
assert.are.equal(
|
||||
polyfill.str_starts("test", "e"),
|
||||
false
|
||||
false,
|
||||
polyfill.str_starts("test", "e")
|
||||
)
|
||||
end)
|
||||
it("should return false for another substring", function()
|
||||
assert.are.equal(
|
||||
polyfill.str_starts("test", "est"),
|
||||
false
|
||||
false,
|
||||
polyfill.str_starts("test", "est")
|
||||
)
|
||||
end)
|
||||
end)
|
||||
|
|
Loading…
Reference in a new issue