aboutsummaryrefslogtreecommitdiffstats
path: root/tests/indent/common.lua
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/indent/common.lua
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
Diffstat (limited to 'tests/indent/common.lua')
-rw-r--r--tests/indent/common.lua2
1 files changed, 1 insertions, 1 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*")