mirror of
https://github.com/sbrl/Minetest-WorldEditAdditions.git
synced 2024-11-22 07:23: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()
|
describe("str_starts", function()
|
||||||
it("should return true for a single character", function()
|
it("should return true for a single character", function()
|
||||||
assert.are.equal(
|
assert.are.equal(
|
||||||
polyfill.str_starts("test", "t"),
|
true,
|
||||||
true
|
polyfill.str_starts("test", "t")
|
||||||
)
|
)
|
||||||
end)
|
end)
|
||||||
it("should return true for a multiple characters", function()
|
it("should return true for a multiple characters", function()
|
||||||
assert.are.equal(
|
assert.are.equal(
|
||||||
polyfill.str_starts("test", "te"),
|
true,
|
||||||
true
|
polyfill.str_starts("test", "te")
|
||||||
)
|
)
|
||||||
end)
|
end)
|
||||||
it("should return true for identical strings", function()
|
it("should return true for identical strings", function()
|
||||||
assert.are.equal(
|
assert.are.equal(
|
||||||
polyfill.str_starts("test", "test"),
|
true,
|
||||||
true
|
polyfill.str_starts("test", "test")
|
||||||
)
|
)
|
||||||
end)
|
end)
|
||||||
it("should return false for a single character ", function()
|
it("should return false for a single character ", function()
|
||||||
assert.are.equal(
|
assert.are.equal(
|
||||||
polyfill.str_starts("test", "y"),
|
false,
|
||||||
false
|
polyfill.str_starts("test", "y")
|
||||||
)
|
)
|
||||||
end)
|
end)
|
||||||
it("should return false for a character present elsewherer", function()
|
it("should return false for a character present elsewherer", function()
|
||||||
assert.are.equal(
|
assert.are.equal(
|
||||||
polyfill.str_starts("test", "e"),
|
false,
|
||||||
false
|
polyfill.str_starts("test", "e")
|
||||||
)
|
)
|
||||||
end)
|
end)
|
||||||
it("should return false for another substring", function()
|
it("should return false for another substring", function()
|
||||||
assert.are.equal(
|
assert.are.equal(
|
||||||
polyfill.str_starts("test", "est"),
|
false,
|
||||||
false
|
polyfill.str_starts("test", "est")
|
||||||
)
|
)
|
||||||
end)
|
end)
|
||||||
end)
|
end)
|
||||||
|
|
Loading…
Reference in a new issue