summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorStephan Seitz <stephan.seitz@fau.de>2022-02-04 23:36:36 +0100
committerStephan Seitz <stephan.seitz@fau.de>2022-02-05 18:54:55 +0100
commitb9069a81b9c42c4d6d1ee4ebc4cd5feb35aa590d (patch)
tree881f031b7e9486048a8fed056542ee26b45c0ad4 /tests
parentca06ff0a61bc521f8ad3a2a280ba2e6f1b10f4c8 (diff)
tests: only compare indents not contents in indent tests
Diffstat (limited to 'tests')
-rw-r--r--tests/indent/common.lua2
-rw-r--r--tests/indent/php_spec.lua2
2 files changed, 2 insertions, 2 deletions
diff --git a/tests/indent/common.lua b/tests/indent/common.lua
index 054ffaac..c9f91214 100644
--- a/tests/indent/common.lua
+++ b/tests/indent/common.lua
@@ -14,7 +14,7 @@ local function same_indent(state, arguments)
local ok = true
local errors = { before = {}, after = {} }
for line = 1, #before do
- if before[line] ~= after[line] then
+ if #string.match(before[line], "^%s*") ~= #string.match(after[line], "^%s*") then
if before[line] and after[line] then
-- store the actual indentation length for each line
errors.before[line] = #string.match(before[line], "^%s*")
diff --git a/tests/indent/php_spec.lua b/tests/indent/php_spec.lua
index b4f2eac4..0620c5ea 100644
--- a/tests/indent/php_spec.lua
+++ b/tests/indent/php_spec.lua
@@ -18,7 +18,7 @@ describe("indent PHP:", function()
run:new_line("example.php", { on_line = 11, text = "// new line starts 1 indentation to far", indent = 4 })
run:new_line(
"example2.php",
- { on_line = 5, text = "// indendation with `enter` in insert mode is not correct", indent = 4 }
+ { on_line = 5, text = "indendation with `enter` in insert mode is not correct", indent = 4 }
)
end)
end)