aboutsummaryrefslogtreecommitdiffstats
path: root/tests/indent/java_spec.lua
blob: 8506992fbcbe09d95ce1bdbc1f25c9eb06c18405 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
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 })
    run:new_line("enum.java", { on_line = 2, text = "THING_B,", indent = 2 })
    run:new_line("class_with_annotation.java", { on_line = 2, text = "void foo() {}", indent = 2 })
    run:new_line("enum_with_annotation.java", { on_line = 2, text = "THING;", indent = 2 })
  end)
end)