phase 2: remove CodeWriter
Some checks failed
ci / ci (push) Failing after 3m7s

This commit is contained in:
2026-04-04 17:05:56 -06:00
parent b00d8d2fa7
commit f12928749b
4 changed files with 55 additions and 148 deletions

View File

@@ -1,30 +0,0 @@
--- @diagnostic disable: undefined-field, need-check-nil, need-check-nil
local CodeWriter = require 'u.codewriter'
describe('CodeWriter', function()
it('should write with indentation', function()
local cw = CodeWriter.new()
cw:write '{'
cw:indent(function(cw2) cw2:write 'x: 123' end)
cw:write '}'
assert.are.same(cw.lines, { '{', ' x: 123', '}' })
end)
it('should keep relative indentation', function()
local cw = CodeWriter.new()
cw:write '{'
cw:indent(function(cw2)
cw2:write 'x: 123'
cw2:write ' y: 123'
end)
cw:write '}'
assert.are.same(cw.lines, {
'{',
' x: 123',
' y: 123',
'}',
})
end)
end)