From 145c2e720c1eb09093aaf006fcb4396dac44620c Mon Sep 17 00:00:00 2001 From: zeertzjq Date: Wed, 19 Feb 2025 16:10:07 +0800 Subject: test(completion_spec): make Enter test descriptions more accurate --- test/functional/editor/completion_spec.lua | 14 ++++++++------ test/functional/legacy/edit_spec.lua | 2 +- 2 files changed, 9 insertions(+), 7 deletions(-) (limited to 'test/functional') diff --git a/test/functional/editor/completion_spec.lua b/test/functional/editor/completion_spec.lua index fdf6917b53..39072ede9c 100644 --- a/test/functional/editor/completion_spec.lua +++ b/test/functional/editor/completion_spec.lua @@ -460,7 +460,7 @@ describe('completion', function() June]]) end) - it('Enter does not select original text', function() + it('Enter inserts newline at original text after adding leader', function() feed('iJ') poke_eventloop() feed('u') @@ -506,21 +506,23 @@ describe('completion', function() ]]) end) - it('Enter selects original text after adding leader and insert newline', function() + it('Enter inserts newline at original text after adding leader', function() feed('iJ') poke_eventloop() feed('u') poke_eventloop() feed('') - expect([[Ju -]]) + expect([[ + Ju + ]]) feed('') poke_eventloop() -- The behavior should be the same when completion has been interrupted, -- which can happen interactively if the completion function is slow. feed('ggVGSJu') - expect([[Ju -]]) + expect([[ + Ju + ]]) end) end) diff --git a/test/functional/legacy/edit_spec.lua b/test/functional/legacy/edit_spec.lua index eee232f2c8..1c165e0335 100644 --- a/test/functional/legacy/edit_spec.lua +++ b/test/functional/legacy/edit_spec.lua @@ -94,7 +94,7 @@ describe('edit', function() end) -- oldtest: Test_edit_CAR() - it('insert a newline when pressing Enter, even if the pum is visible', function() + it('Enter inserts newline with pum at original text after adding leader', function() local screen = Screen.new(10, 6) command('set cot=menu,menuone,noselect') feed('Shello herohe') -- cgit