mirror of
https://github.com/sbrl/Minetest-WorldEditAdditions.git
synced 2024-11-05 06:53:52 +01:00
tests: grammar
This commit is contained in:
parent
8d79e6f0ab
commit
be8e097f1f
@ -1,43 +1,43 @@
|
|||||||
local polyfill = require("worldeditadditions_core.utils.strings.polyfill")
|
local polyfill = require("worldeditadditions_core.utils.strings.polyfill")
|
||||||
|
|
||||||
describe("trim", function()
|
describe("trim", function()
|
||||||
it("work for a string that's already trimmed", function()
|
it("should work for a string that's already trimmed", function()
|
||||||
assert.are.equal(
|
assert.are.equal(
|
||||||
polyfill.trim("test"),
|
polyfill.trim("test"),
|
||||||
"test"
|
"test"
|
||||||
)
|
)
|
||||||
end)
|
end)
|
||||||
it("trim from the start", function()
|
it("should trim from the start", function()
|
||||||
assert.are.equal(
|
assert.are.equal(
|
||||||
polyfill.trim(" test"),
|
polyfill.trim(" test"),
|
||||||
"test"
|
"test"
|
||||||
)
|
)
|
||||||
end)
|
end)
|
||||||
it("trim from the end", function()
|
it("should trim from the end", function()
|
||||||
assert.are.equal(
|
assert.are.equal(
|
||||||
polyfill.trim("test "),
|
polyfill.trim("test "),
|
||||||
"test"
|
"test"
|
||||||
)
|
)
|
||||||
end)
|
end)
|
||||||
it("trim from both ends", function()
|
it("should trim from both ends", function()
|
||||||
assert.are.equal(
|
assert.are.equal(
|
||||||
polyfill.trim(" test "),
|
polyfill.trim(" test "),
|
||||||
"test"
|
"test"
|
||||||
)
|
)
|
||||||
end)
|
end)
|
||||||
it("trim another string", function()
|
it("should trim another string", function()
|
||||||
assert.are.equal(
|
assert.are.equal(
|
||||||
polyfill.trim("yay "),
|
polyfill.trim("yay "),
|
||||||
"yay"
|
"yay"
|
||||||
)
|
)
|
||||||
end)
|
end)
|
||||||
it("trim tabs", function()
|
it("should trim tabs", function()
|
||||||
assert.are.equal(
|
assert.are.equal(
|
||||||
polyfill.trim("//forest "),
|
polyfill.trim("//forest "),
|
||||||
"//forest"
|
"//forest"
|
||||||
)
|
)
|
||||||
end)
|
end)
|
||||||
it("avoid trimming spaces in the middle", function()
|
it("should avoid trimming spaces in the middle", function()
|
||||||
assert.are.equal(
|
assert.are.equal(
|
||||||
polyfill.trim("te st "),
|
polyfill.trim("te st "),
|
||||||
"te st"
|
"te st"
|
||||||
|
Loading…
Reference in New Issue
Block a user