2022-08-31 00:23:49 +02:00
|
|
|
local Runner = require("tests.indent.common").Runner
|
|
|
|
|
--local XFAIL = require("tests.indent.common").XFAIL
|
|
|
|
|
|
|
|
|
|
local run = Runner:new(it, "tests/indent/wgsl", {
|
2023-06-05 09:52:36 +09:00
|
|
|
tabstop = 2,
|
|
|
|
|
shiftwidth = 2,
|
2022-08-31 00:23:49 +02:00
|
|
|
softtabstop = 0,
|
|
|
|
|
expandtab = true,
|
|
|
|
|
})
|
|
|
|
|
|
|
|
|
|
describe("indent WGSL:", function()
|
|
|
|
|
describe("whole file:", function()
|
|
|
|
|
run:whole_file(".", {
|
|
|
|
|
expected_failures = {},
|
|
|
|
|
})
|
|
|
|
|
end)
|
|
|
|
|
|
2024-11-03 21:13:52 -08:00
|
|
|
describe("new line:", function()
|
|
|
|
|
run:new_line("basic.wgsl", { on_line = 47, text = "c: u32,", indent = 2 })
|
|
|
|
|
run:new_line("basic.wgsl", { on_line = 52, text = "c: u32,", indent = 2 })
|
|
|
|
|
run:new_line("basic.wgsl", { on_line = 56, text = "c: u32,", indent = 2 })
|
|
|
|
|
run:new_line("basic.wgsl", { on_line = 59, text = "c: u32,", indent = 2 })
|
2024-11-06 12:09:14 -06:00
|
|
|
run:new_line("type_constructor_or_function_call_expression.wgsl", {
|
|
|
|
|
on_line = 3,
|
|
|
|
|
text = "b",
|
|
|
|
|
indent = 4,
|
|
|
|
|
})
|
|
|
|
|
run:new_line("type_constructor_or_function_call_expression.wgsl", {
|
|
|
|
|
on_line = 4,
|
|
|
|
|
text = "c",
|
|
|
|
|
indent = 4,
|
|
|
|
|
})
|
|
|
|
|
run:new_line("type_constructor_or_function_call_expression.wgsl", {
|
|
|
|
|
on_line = 8,
|
|
|
|
|
text = "b",
|
|
|
|
|
indent = 4,
|
|
|
|
|
})
|
|
|
|
|
run:new_line("type_constructor_or_function_call_expression.wgsl", {
|
|
|
|
|
on_line = 9,
|
|
|
|
|
text = "c",
|
|
|
|
|
indent = 4,
|
|
|
|
|
})
|
2024-11-03 21:13:52 -08:00
|
|
|
end)
|
2022-08-31 00:23:49 +02:00
|
|
|
end)
|