From 474c59dcf1d5586d6ef0d3f91b380c6c25eb314b Mon Sep 17 00:00:00 2001 From: Pham Huy Hoang Date: Mon, 3 Apr 2023 23:47:41 +0900 Subject: add test --- tests/indent/algorithm_spec.lua | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 tests/indent/algorithm_spec.lua (limited to 'tests/indent/algorithm_spec.lua') diff --git a/tests/indent/algorithm_spec.lua b/tests/indent/algorithm_spec.lua new file mode 100644 index 000000000..faf7998ec --- /dev/null +++ b/tests/indent/algorithm_spec.lua @@ -0,0 +1,18 @@ +local Runner = require("tests.indent.common").Runner +-- local XFAIL = require("tests.indent.common").XFAIL + +local runner = Runner:new(it, "tests/indent/algorithm", { + tabstop = 4, + shiftwidth = 4, + softtabstop = 4, + expandtab = true, +}) + +describe("test indent algorithm: ", function() + describe("new line:", function() + runner:new_line("trailing.py", { on_line = 1, text = "x: str", indent = 4 }, "indent next line, ignore comment") + runner:new_line("trailing.py", { on_line = 4, text = "pass", indent = 8 }, "indent next line, ignore comment") + runner:new_line("trailing.py", { on_line = 6, text = "pass", indent = 4 }, "indent next line, ignore whitespace") + runner:new_line("trailing_whitespace.html", { on_line = 9, text = "x", indent = 8 }, "not ignore @indent.end") + end) +end) -- cgit v1.2.3-70-g09d2