tests/str_starts: fix assert calls

This commit is contained in:
Starbeamrainbowlabs 2021-12-31 01:34:41 +00:00
parent 4597edcf1e
commit 70d6f36444
Signed by: sbrl
GPG key ID: 1BE5172E637709C2

View file

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