Skip to content

Commit

Permalink
add test case for blank line
Browse files Browse the repository at this point in the history
  • Loading branch information
glepnir committed Apr 28, 2024
1 parent 4eca6c9 commit cae26f3
Showing 1 changed file with 34 additions and 0 deletions.
34 changes: 34 additions & 0 deletions test/indentmini_spec.lua
Original file line number Diff line number Diff line change
Expand Up @@ -105,4 +105,38 @@ describe('indent mini', function()
}
assert.same(expected, screenstr)
end)

it('works on blank line', function()
local lines = {
'local function test()',
' while true do',
' if true then',
' if true then',
'',
'',
'',
' print("test")',
' end',
' end',
' end',
'end',
}

local screenstr = screen(lines)
local expected = {
'local function test() ',
'┇ while true do ',
'┇ ┇ if true then ',
'┇ ┇ ┇ if true then ',
'┇ ┇ ┇ ┇ ',
'┇ ┇ ┇ ┇ ',
'┇ ┇ ┇ ┇ ',
'┇ ┇ ┇ ┇ print("test") ',
'┇ ┇ ┇ end ',
'┇ ┇ end ',
'┇ end ',
'end ',
}
assert.same(expected, screenstr)
end)
end)

0 comments on commit cae26f3

Please sign in to comment.