From d3a3056204e1a9dbb7c7fe36c114dc43b681768c Mon Sep 17 00:00:00 2001 From: jmp <59481467+mcauley-penney@users.noreply.github.com> Date: Tue, 17 Oct 2023 23:37:12 -0700 Subject: [PATCH] ci: fix broken tests (#1729) 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. --- lua/cmp/core_spec.lua | 6 +++--- lua/cmp/utils/feedkeys_spec.lua | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/lua/cmp/core_spec.lua b/lua/cmp/core_spec.lua index eb0c9326d..9134c4493 100644 --- a/lua/cmp/core_spec.lua +++ b/lua/cmp/core_spec.lua @@ -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) diff --git a/lua/cmp/utils/feedkeys_spec.lua b/lua/cmp/utils/feedkeys_spec.lua index 24fba71a4..040373712 100644 --- a/lua/cmp/utils/feedkeys_spec.lua +++ b/lua/cmp/utils/feedkeys_spec.lua @@ -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'), 'nx') assert.are.same(vim.api.nvim_buf_get_lines(0, 0, -1, false), {