2022-01-24 20:39:18 +01:00
|
|
|
local Runner = require("tests.indent.common").Runner
|
|
|
|
|
|
|
|
|
|
local run = Runner:new(it, "tests/indent/php", {
|
|
|
|
|
tabstop = 4,
|
|
|
|
|
shiftwidth = 4,
|
|
|
|
|
softtabstop = 0,
|
|
|
|
|
expandtab = true,
|
|
|
|
|
})
|
|
|
|
|
|
|
|
|
|
describe("indent PHP:", function()
|
|
|
|
|
describe("whole file:", function()
|
|
|
|
|
run:whole_file(".", {
|
2022-05-14 17:25:38 +02:00
|
|
|
expected_failures = {},
|
2022-01-24 20:39:18 +01:00
|
|
|
})
|
|
|
|
|
end)
|
|
|
|
|
|
|
|
|
|
describe("new line:", function()
|
|
|
|
|
run:new_line("example.php", { on_line = 11, text = "// new line starts 1 indentation to far", indent = 4 })
|
2022-01-24 21:16:00 +01:00
|
|
|
run:new_line(
|
|
|
|
|
"example2.php",
|
2023-02-23 20:30:36 +01:00
|
|
|
{ on_line = 5, text = "indentation with `enter` in insert mode is not correct", indent = 4 }
|
2022-01-24 21:16:00 +01:00
|
|
|
)
|
2022-02-12 23:12:07 +01:00
|
|
|
run:new_line("issue-2497.php", { on_line = 5, text = "$a =", indent = 4 })
|
2023-10-06 18:34:46 +01:00
|
|
|
run:new_line("unfinished-call.php", { on_line = 6, text = "$a =", indent = 4 })
|
2022-10-06 09:17:35 +02:00
|
|
|
run:new_line("issue-3591.php", { on_line = 4, text = "$a =", indent = 8 })
|
2022-10-07 11:08:29 +02:00
|
|
|
run:new_line("enum-indent.php", { on_line = 4, text = "case", indent = 4 })
|
2022-01-24 20:39:18 +01:00
|
|
|
end)
|
|
|
|
|
end)
|