Added fix for incorrect Java indentation after a closing "}" in a method declaration

Added tests for Java indentation, including one for issue 2571
This commit is contained in:
Daniel Woznicki 2022-02-24 15:41:15 -08:00 committed by Stephan Seitz
parent fb7a56548b
commit b425a9c813
4 changed files with 36 additions and 0 deletions

View file

@ -0,0 +1,23 @@
local Runner = require("tests.indent.common").Runner
--local XFAIL = require("tests.indent.common").XFAIL
local run = Runner:new(it, "tests/indent/java", {
tabstop = 2,
shiftwidth = 2,
softtabstop = 0,
expandtab = true,
})
describe("indent Java:", function()
describe("whole file:", function()
run:whole_file(".", {
expected_failures = {},
})
end)
describe("new line:", function()
run:new_line("method.java", { on_line = 1, text = "void foo() {}", indent = 2 })
run:new_line("issue_2571.java", { on_line = 5, text = "void bar() {}", indent = 2 })
end)
end)