aboutsummaryrefslogtreecommitdiffstats
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
parentindents(r): fix all R tests (diff)
downloadnvim-treesitter-b9069a81b9c42c4d6d1ee4ebc4cd5feb35aa590d.tar
nvim-treesitter-b9069a81b9c42c4d6d1ee4ebc4cd5feb35aa590d.tar.gz
nvim-treesitter-b9069a81b9c42c4d6d1ee4ebc4cd5feb35aa590d.tar.bz2
nvim-treesitter-b9069a81b9c42c4d6d1ee4ebc4cd5feb35aa590d.tar.lz
nvim-treesitter-b9069a81b9c42c4d6d1ee4ebc4cd5feb35aa590d.tar.xz
nvim-treesitter-b9069a81b9c42c4d6d1ee4ebc4cd5feb35aa590d.tar.zst
nvim-treesitter-b9069a81b9c42c4d6d1ee4ebc4cd5feb35aa590d.zip
tests: only compare indents not contents in indent 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 054ffaacf..c9f91214e 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 b4f2eac47..0620c5ea6 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)