tests/str_starts: fix assert calls

This commit is contained in:
Starbeamrainbowlabs 2021-12-31 01:34:41 +00:00
parent 4597edcf1e
commit 70d6f36444
No known key found for this signature in database
GPG Key ID: 1BE5172E637709C2

@ -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)