fix(indent): lua - support @indent_end (#2454)

This commit is contained in:
Munif Tanjim 2022-02-05 03:08:18 +06:00 committed by GitHub
parent 9f69999e2a
commit 11e7ee1d91
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 8 additions and 0 deletions

View file

@ -22,7 +22,9 @@ describe("indent Lua:", function()
run:new_line("comment.lua", { on_line = 5, text = "multiline", indent = " " }, "expected failure", XFAIL)
run:new_line("func.lua", { on_line = 1, text = "x = x + 1", indent = 2 })
run:new_line("func.lua", { on_line = 2, text = "y = y + 1", indent = 4 })
run:new_line("func.lua", { on_line = 4, text = "y = y + 1", indent = 2 })
run:new_line("func.lua", { on_line = 5, text = "3,", indent = 4 })
run:new_line("func.lua", { on_line = 9, text = "x = x + 1", indent = 0 })
run:new_line("string.lua", { on_line = 1, text = "x", indent = 0 })
run:new_line("string.lua", { on_line = 2, text = "x", indent = 0 })
run:new_line("string.lua", { on_line = 3, text = "x", indent = 2 })
@ -34,5 +36,7 @@ describe("indent Lua:", function()
run:new_line("cond.lua", { on_line = 5, text = "x = x + 1", indent = 2 })
run:new_line("cond.lua", { on_line = 7, text = "x = x + 1", indent = 2 })
run:new_line("cond.lua", { on_line = 8, text = "x = x + 1", indent = 4 })
run:new_line("cond.lua", { on_line = 10, text = "x = x + 1", indent = 2 })
run:new_line("cond.lua", { on_line = 12, text = "x = x + 1", indent = 0 })
end)
end)