aboutsummaryrefslogtreecommitdiffstats
path: root/tests/indent/nickel_spec.lua
blob: d178dab523c20712eb93f78c71b059c7f84bb6c5 (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 run = Runner:new(it, "tests/indent/nickel", {
  shiftwidth = 2,
  expandtab = true,
})

describe("indent Nickel:", function()
  describe("whole file:", function()
    run:whole_file(".", {
      expected_failures = {},
    })
  end)

  describe("new line:", function()
    run:new_line("indent-newline.ncl", { on_line = 1, text = "stmt", indent = 2 })
    run:new_line("indent-newline.ncl", { on_line = 2, text = "stmt", indent = 2 })
    run:new_line("indent-newline.ncl", { on_line = 3, text = "stmt", indent = 4 })
    run:new_line("indent-newline.ncl", { on_line = 4, text = "]", indent = 2 })
    run:new_line("indent-newline.ncl", { on_line = 5, text = "stmt", indent = 2 })
    run:new_line("indent-newline.ncl", { on_line = 6, text = "stmt", indent = 4 })
    run:new_line("indent-newline.ncl", { on_line = 7, text = "}", indent = 2 })
    run:new_line("indent-newline.ncl", { on_line = 11, text = "stmt", indent = 0 })
  end)
end)