Implement ale.pad in Lua

This commit is contained in:
w0rp
2025-03-22 00:43:29 +00:00
parent b85e5191a3
commit db43854ca3
3 changed files with 30 additions and 1 deletions

13
test/lua/ale_pad_spec.lua Normal file
View File

@@ -0,0 +1,13 @@
local eq = assert.are.same
local ale = require("ale")
describe("ale.pad", function()
it("should pad non-empty strings", function()
eq(" foo", ale.pad("foo"))
end)
it("should return empty strings for nil or empty strings", function()
eq("", ale.pad(nil))
eq("", ale.pad(""))
end)
end)