mirror of
https://github.com/nvim-treesitter/nvim-treesitter.git
synced 2026-07-17 19:00:02 -04:00
tests: only compare indents not contents in indent tests
This commit is contained in:
parent
ca06ff0a61
commit
b9069a81b9
2 changed files with 2 additions and 2 deletions
|
|
@ -14,7 +14,7 @@ local function same_indent(state, arguments)
|
||||||
local ok = true
|
local ok = true
|
||||||
local errors = { before = {}, after = {} }
|
local errors = { before = {}, after = {} }
|
||||||
for line = 1, #before do
|
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
|
if before[line] and after[line] then
|
||||||
-- store the actual indentation length for each line
|
-- store the actual indentation length for each line
|
||||||
errors.before[line] = #string.match(before[line], "^%s*")
|
errors.before[line] = #string.match(before[line], "^%s*")
|
||||||
|
|
|
||||||
|
|
@ -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("example.php", { on_line = 11, text = "// new line starts 1 indentation to far", indent = 4 })
|
||||||
run:new_line(
|
run:new_line(
|
||||||
"example2.php",
|
"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)
|
||||||
end)
|
end)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue