diff options
Diffstat (limited to 'test/functional')
-rw-r--r-- | test/functional/core/job_spec.lua | 1 | ||||
-rw-r--r-- | test/functional/legacy/fixeol_spec.lua | 11 | ||||
-rw-r--r-- | test/functional/ui/inccommand_spec.lua | 102 | ||||
-rw-r--r-- | test/functional/ui/winbar_spec.lua | 19 |
4 files changed, 127 insertions, 6 deletions
diff --git a/test/functional/core/job_spec.lua b/test/functional/core/job_spec.lua index cf24e570cb..461a69f357 100644 --- a/test/functional/core/job_spec.lua +++ b/test/functional/core/job_spec.lua @@ -682,6 +682,7 @@ describe('jobs', function() -- User can explicitly set $NVIM_LOG_FILE, $VIM, $VIMRUNTIME. eq('NVIM_LOG_FILE=Xtest_jobstart_env', get_env_in_child_job('NVIM_LOG_FILE', { NVIM_LOG_FILE='Xtest_jobstart_env' })) + os.remove('Xtest_jobstart_env') end) describe('jobwait', function() diff --git a/test/functional/legacy/fixeol_spec.lua b/test/functional/legacy/fixeol_spec.lua index d3ff86d349..3cc9d54e2b 100644 --- a/test/functional/legacy/fixeol_spec.lua +++ b/test/functional/legacy/fixeol_spec.lua @@ -6,12 +6,11 @@ local clear, feed_command, expect = helpers.clear, helpers.feed_command, helpers describe('fixeol', function() local function rmtestfiles() - feed_command('%bwipeout!') - feed_command('call delete("test.out")') - feed_command('call delete("XXEol")') - feed_command('call delete("XXNoEol")') - feed_command('call delete("XXTestEol")') - feed_command('call delete("XXTestNoEol")') + os.remove("test.out") + os.remove("XXEol") + os.remove("XXNoEol") + os.remove("XXTestEol") + os.remove("XXTestNoEol") end setup(function() clear() diff --git a/test/functional/ui/inccommand_spec.lua b/test/functional/ui/inccommand_spec.lua index fb80444430..a1ff778da1 100644 --- a/test/functional/ui/inccommand_spec.lua +++ b/test/functional/ui/inccommand_spec.lua @@ -1343,6 +1343,108 @@ describe(":substitute, inccommand=split", function() ]]) end) + it([[preview changes correctly with c_CTRL-R_= and c_CTRL-\_e]], function() + feed('gg') + feed(":1,2s/t/X") + screen:expect([[ + Inc subs{12:X}itution on | + {12:X}wo lines | + Inc substitution on | + two lines | + | + {11:[No Name] [+] }| + |1| Inc subs{12:X}itution on | + |2| {12:X}wo lines | + {15:~ }| + {15:~ }| + {15:~ }| + {15:~ }| + {15:~ }| + {10:[Preview] }| + :1,2s/t/X^ | + ]]) + + feed([[<C-R>='Y']]) + -- preview should be unchanged during c_CTRL-R_= editing + screen:expect([[ + Inc subs{12:X}itution on | + {12:X}wo lines | + Inc substitution on | + two lines | + | + {11:[No Name] [+] }| + |1| Inc subs{12:X}itution on | + |2| {12:X}wo lines | + {15:~ }| + {15:~ }| + {15:~ }| + {15:~ }| + {15:~ }| + {10:[Preview] }| + ={1:'Y'}^ | + ]]) + + feed('<CR>') + -- preview should be changed by the result of the expression + screen:expect([[ + Inc subs{12:XY}itution on | + {12:XY}wo lines | + Inc substitution on | + two lines | + | + {11:[No Name] [+] }| + |1| Inc subs{12:XY}itution on | + |2| {12:XY}wo lines | + {15:~ }| + {15:~ }| + {15:~ }| + {15:~ }| + {15:~ }| + {10:[Preview] }| + :1,2s/t/XY^ | + ]]) + + feed([[<C-\>e'echo']]) + -- preview should be unchanged during c_CTRL-\_e editing + screen:expect([[ + Inc subs{12:XY}itution on | + {12:XY}wo lines | + Inc substitution on | + two lines | + | + {11:[No Name] [+] }| + |1| Inc subs{12:XY}itution on | + |2| {12:XY}wo lines | + {15:~ }| + {15:~ }| + {15:~ }| + {15:~ }| + {15:~ }| + {10:[Preview] }| + ={1:'echo'}^ | + ]]) + + feed('<CR>') + -- preview should be cleared if command is changed to a non-previewable one + screen:expect([[ + Inc substitution on | + two lines | + Inc substitution on | + two lines | + | + {15:~ }| + {15:~ }| + {15:~ }| + {15:~ }| + {15:~ }| + {15:~ }| + {15:~ }| + {15:~ }| + {15:~ }| + :echo^ | + ]]) + end) + end) describe("inccommand=nosplit", function() diff --git a/test/functional/ui/winbar_spec.lua b/test/functional/ui/winbar_spec.lua index 982d2d67fd..92a6ab2e84 100644 --- a/test/functional/ui/winbar_spec.lua +++ b/test/functional/ui/winbar_spec.lua @@ -26,6 +26,8 @@ describe('winbar', function() [7] = {background = Screen.colors.LightGrey}, [8] = {background = Screen.colors.LightMagenta}, [9] = {bold = true, foreground = Screen.colors.Blue, background = Screen.colors.LightMagenta}, + [10] = {background = Screen.colors.LightGrey, underline = true}, + [11] = {background = Screen.colors.LightGrey, underline = true, bold = true, foreground = Screen.colors.Magenta}, }) meths.set_option('winbar', 'Set Up The Bars') end) @@ -245,6 +247,23 @@ describe('winbar', function() {4:[No Name] }| | ]]) + -- Test for issue #18791 + command('tabnew') + screen:expect([[ + {10: }{11:4}{10: [No Name] }{1: [No Name] }{2: }{10:X}| + {1:Set Up The Bars }| + ^ | + {3:~ }| + {3:~ }| + {3:~ }| + {3:~ }| + {3:~ }| + {3:~ }| + {3:~ }| + {3:~ }| + {4:[No Name] }| + | + ]]) end) it('mouse click and drag work correctly in buffer', function() |