summaryrefslogtreecommitdiff
path: root/tests/indent/c_spec.lua
diff options
context:
space:
mode:
authorStephan Seitz <stephan.seitz@fau.de>2021-11-20 15:14:56 +0100
committerStephan Seitz <stephan.seitz@fau.de>2021-11-24 17:29:55 +0100
commitc7634f16dee010d092cad867959a51962406fc62 (patch)
tree9e4747a585df28ff7239a85b099c22bddedb010b /tests/indent/c_spec.lua
parent0f3c94cf7237f8d0ba613666394e248d1947de77 (diff)
Mark failing indent tests to add them to CI
Expected failures should be monitored so that we don't have regressions and also remove failure marks when they are resolved.
Diffstat (limited to 'tests/indent/c_spec.lua')
-rw-r--r--tests/indent/c_spec.lua22
1 files changed, 18 insertions, 4 deletions
diff --git a/tests/indent/c_spec.lua b/tests/indent/c_spec.lua
index 1bdd0165..203dc7be 100644
--- a/tests/indent/c_spec.lua
+++ b/tests/indent/c_spec.lua
@@ -1,4 +1,5 @@
local Runner = require("tests.indent.common").Runner
+local XFAIL = require("tests.indent.common").XFAIL
local runner = Runner:new(it, "tests/indent/c", {
tabstop = 4,
@@ -9,7 +10,20 @@ local runner = Runner:new(it, "tests/indent/c", {
describe("indent C:", function()
describe("whole file:", function()
- runner:whole_file "."
+ runner:whole_file(".", {
+ expected_failures = {
+ "./ternary.c",
+ "./string.c",
+ "./preproc_func.c",
+ "./preproc_cond.c",
+ "./no_braces.c",
+ "./label.c",
+ "./func.c",
+ "./expr.c",
+ "./comment.c",
+ "./array.c",
+ },
+ })
end)
describe("new line:", function()
@@ -19,17 +33,17 @@ describe("indent C:", function()
runner:new_line("cond.c", { on_line = 8, text = "x++;", indent = 8 })
runner:new_line("expr.c", { on_line = 10, text = "2 *", indent = 8 })
runner:new_line("func.c", { on_line = 17, text = "int z,", indent = 4 })
- runner:new_line("label.c", { on_line = 3, text = "normal:", indent = 0 })
+ runner:new_line("label.c", { on_line = 3, text = "normal:", indent = 0 }, "expected failure", XFAIL)
runner:new_line("loop.c", { on_line = 3, text = "x++;", indent = 8 })
runner:new_line("preproc_cond.c", { on_line = 5, text = "x++;", indent = 4 })
runner:new_line("preproc_func.c", { on_line = 3, text = "x++; \\", indent = 8 })
- runner:new_line("string.c", { on_line = 1, text = "brave new \\", indent = 0 })
+ runner:new_line("string.c", { on_line = 1, text = "brave new \\", indent = 0 }, "expected failure", XFAIL)
runner:new_line("string.c", { on_line = 4, text = '"brave new "', indent = 4 })
runner:new_line("struct.c", { on_line = 4, text = "int y;", indent = 8 })
runner:new_line("switch.c", { on_line = 3, text = "x++;", indent = 12 })
runner:new_line("ternary.c", { on_line = 4, text = ": (x == 0) : 0", indent = 8 })
-- the line after inserted one will be left with wrong indent but we only care about the inserted one
- runner:new_line("no_braces.c", { on_line = 4, text = "x++;", indent = 8 })
+ runner:new_line("no_braces.c", { on_line = 4, text = "x++;", indent = 8 }, "expected failure", XFAIL)
runner:new_line("no_braces.c", { on_line = 7, text = "x++;", indent = 8 })
runner:new_line("no_braces.c", { on_line = 10, text = "x++;", indent = 8 })
end)