Skip to content

Commit

Permalink
ci: fix broken tests (#1729)
Browse files Browse the repository at this point in the history
feedkeys_spec.lua:
In the "backspace test spec, the backspace
setting is given an integer, but only accepts
strings. Here, I assume that 0 was intended to
set backspace to a nil value, which can be done
with the empty string. I also corrected the name
of the test spec.

core_spec.lua:
In the "textedit" test spec, the actual and
expected outputs as well as the actual and
expected end characters did not match.
  • Loading branch information
mcauley-penney authored Oct 18, 2023
1 parent 5dce1b7 commit d3a3056
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
6 changes: 3 additions & 3 deletions lua/cmp/core_spec.lua
Original file line number Diff line number Diff line change
Expand Up @@ -220,11 +220,11 @@ describe('cmp.core', function()
character = 6,
},
},
newText = 'foobarbaz',
newText = 'AIUEO',
},
})
assert.are.same(state.buffer, { '***foobarbaz***' })
assert.are.same(state.cursor[2], 12)
assert.are.same(state.buffer, { '***AIUEO***' })
assert.are.same(state.cursor[2], 6)
end)
end)
end)
Expand Down
4 changes: 2 additions & 2 deletions lua/cmp/utils/feedkeys_spec.lua
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@ describe('feedkeys', function()
})
end)

it('bacckspace', function()
vim.cmd([[setlocal backspace=0]])
it('backspace', function()
vim.cmd([[setlocal backspace=""]])
feedkeys.call(keymap.t('iaiueo'), 'nx')
feedkeys.call(keymap.t('a<BS><BS>'), 'nx')
assert.are.same(vim.api.nvim_buf_get_lines(0, 0, -1, false), {
Expand Down

0 comments on commit d3a3056

Please sign in to comment.