diff options
author | Justin M. Keyes <justinkz@gmail.com> | 2018-12-27 22:49:44 +0100 |
---|---|---|
committer | Justin M. Keyes <justinkz@gmail.com> | 2018-12-27 22:49:44 +0100 |
commit | c1015121ec626cab6cb384f544bc0be1a1760c0e (patch) | |
tree | 6cc9a5d1899a4486a24c491e07d17a7dd01f9503 /test/functional/ex_cmds | |
parent | 4f030ec24e0e148bbb83aedaef7dd629e5fef130 (diff) | |
parent | e1876c7ad1b5e30c0a9919e2c4587d11550c8507 (diff) | |
download | rneovim-c1015121ec626cab6cb384f544bc0be1a1760c0e.tar.gz rneovim-c1015121ec626cab6cb384f544bc0be1a1760c0e.tar.bz2 rneovim-c1015121ec626cab6cb384f544bc0be1a1760c0e.zip |
Merge 'upstream/master' into pr-win-erw7
Diffstat (limited to 'test/functional/ex_cmds')
-rw-r--r-- | test/functional/ex_cmds/cmd_map_spec.lua | 34 | ||||
-rw-r--r-- | test/functional/ex_cmds/debug_spec.lua | 142 | ||||
-rw-r--r-- | test/functional/ex_cmds/swapfile_preserve_recover_spec.lua | 8 |
3 files changed, 113 insertions, 71 deletions
diff --git a/test/functional/ex_cmds/cmd_map_spec.lua b/test/functional/ex_cmds/cmd_map_spec.lua index 67b3ab49d6..a5ce1abff7 100644 --- a/test/functional/ex_cmds/cmd_map_spec.lua +++ b/test/functional/ex_cmds/cmd_map_spec.lua @@ -29,6 +29,9 @@ describe('mappings with <Cmd>', function() [5] = {background = Screen.colors.LightGrey}, [6] = {foreground = Screen.colors.Blue1}, [7] = {bold = true, reverse = true}, + [8] = {background = Screen.colors.WebGray}, + [9] = {background = Screen.colors.LightMagenta}, + [10] = {foreground = Screen.colors.Red}, }) screen:attach() @@ -656,6 +659,37 @@ describe('mappings with <Cmd>', function() eq('n', eval('mode(1)')) end) + it('works in insert completion (Ctrl-X) mode', function() + feed('os<c-x><c-n>') + screen:expect([[ + some short lines | + some^ | + {8:some } | + {9:short }{1: }| + {1:~ }| + {1:~ }| + {1:~ }| + {4:-- Keyword Local completion (^N^P) }{3:match 1 of 2} | + ]]) + + feed('<f3>') + eq('ic', eval('m')) + + -- ensure a redraw, this would have moved the cursor + -- instead if CTRL-X mode was left. + feed('<up>') + screen:expect([[ + some short lines | + some^ | + {9:some } | + {9:short }{1: }| + {1:~ }| + {1:~ }| + {1:~ }| + {4:-- Keyword Local completion (^N^P) }{10:Back at original} | + ]]) + end) + it('works in cmdline mode', function() feed(':text<F3>') eq('c', eval('m')) diff --git a/test/functional/ex_cmds/debug_spec.lua b/test/functional/ex_cmds/debug_spec.lua index 5dad8098ea..a4d381d3f1 100644 --- a/test/functional/ex_cmds/debug_spec.lua +++ b/test/functional/ex_cmds/debug_spec.lua @@ -7,7 +7,7 @@ describe(':debug', function() local screen before_each(function() clear() - screen = Screen.new(50, 14) + screen = Screen.new(30, 14) screen:set_default_attr_ids({ [1] = {bold = true, foreground = Screen.colors.Blue1}, [2] = {bold = true, reverse = true}, @@ -19,92 +19,92 @@ describe(':debug', function() it('scrolls messages correctly', function() feed(':echoerr bork<cr>') screen:expect([[ - | - {1:~ }| - {1:~ }| - {1:~ }| - {1:~ }| - {1:~ }| - {1:~ }| - {1:~ }| - {1:~ }| - {1:~ }| - {2: }| - {3:E121: Undefined variable: bork} | - {3:E15: Invalid expression: bork} | - {4:Press ENTER or type command to continue}^ | + | + {1:~ }| + {1:~ }| + {1:~ }| + {1:~ }| + {1:~ }| + {1:~ }| + {1:~ }| + {1:~ }| + {2: }| + {3:E121: Undefined variable: bork}| + | + {4:Press ENTER or type command to}| + {4: continue}^ | ]]) feed(':debug echo "aa"| echo "bb"<cr>') screen:expect([[ - | - {1:~ }| - {1:~ }| - {1:~ }| - {1:~ }| - {1:~ }| - {1:~ }| - {1:~ }| - {2: }| - {3:E121: Undefined variable: bork} | - {3:E15: Invalid expression: bork} | - Entering Debug mode. Type "cont" to continue. | - cmd: echo "aa"| echo "bb" | - >^ | + | + {1:~ }| + {1:~ }| + {1:~ }| + {1:~ }| + {1:~ }| + {2: }| + {3:E121: Undefined variable: bork}| + | + {4:Press ENTER or type command to}| + Entering Debug mode. Type "co| + nt" to continue. | + cmd: echo "aa"| echo "bb" | + >^ | ]]) feed('step<cr>') screen:expect([[ - | - {1:~ }| - {1:~ }| - {1:~ }| - {1:~ }| - {2: }| - {3:E121: Undefined variable: bork} | - {3:E15: Invalid expression: bork} | - Entering Debug mode. Type "cont" to continue. | - cmd: echo "aa"| echo "bb" | - >step | - aa | - cmd: echo "bb" | - >^ | + | + {1:~ }| + {1:~ }| + {2: }| + {3:E121: Undefined variable: bork}| + | + {4:Press ENTER or type command to}| + Entering Debug mode. Type "co| + nt" to continue. | + cmd: echo "aa"| echo "bb" | + >step | + aa | + cmd: echo "bb" | + >^ | ]]) feed('step<cr>') screen:expect([[ - | - {1:~ }| - {1:~ }| - {2: }| - {3:E121: Undefined variable: bork} | - {3:E15: Invalid expression: bork} | - Entering Debug mode. Type "cont" to continue. | - cmd: echo "aa"| echo "bb" | - >step | - aa | - cmd: echo "bb" | - >step | - bb | - {4:Press ENTER or type command to continue}^ | + {2: }| + {3:E121: Undefined variable: bork}| + | + {4:Press ENTER or type command to}| + Entering Debug mode. Type "co| + nt" to continue. | + cmd: echo "aa"| echo "bb" | + >step | + aa | + cmd: echo "bb" | + >step | + bb | + {4:Press ENTER or type command to}| + {4: continue}^ | ]]) feed('<cr>') screen:expect([[ - ^ | - {1:~ }| - {1:~ }| - {1:~ }| - {1:~ }| - {1:~ }| - {1:~ }| - {1:~ }| - {1:~ }| - {1:~ }| - {1:~ }| - {1:~ }| - {1:~ }| - | + ^ | + {1:~ }| + {1:~ }| + {1:~ }| + {1:~ }| + {1:~ }| + {1:~ }| + {1:~ }| + {1:~ }| + {1:~ }| + {1:~ }| + {1:~ }| + {1:~ }| + | ]]) end) end) diff --git a/test/functional/ex_cmds/swapfile_preserve_recover_spec.lua b/test/functional/ex_cmds/swapfile_preserve_recover_spec.lua index 577a26178a..3fcffd422f 100644 --- a/test/functional/ex_cmds/swapfile_preserve_recover_spec.lua +++ b/test/functional/ex_cmds/swapfile_preserve_recover_spec.lua @@ -11,6 +11,7 @@ local ok = helpers.ok local rmdir = helpers.rmdir local set_session = helpers.set_session local spawn = helpers.spawn +local nvim_async = helpers.nvim_async describe(':recover', function() before_each(clear) @@ -150,5 +151,12 @@ describe('swapfile detection', function() feed('e') -- Chose "Edit" at the swap dialog. feed('<c-c>') screen2:expect(expected_no_dialog) + + -- With API call and shortmess+=F + nvim_async('command', 'edit %') + screen2:expect{any=[[Found a swap file by the name ".*]] + ..[[Xtest_swapdialog_dir[/\].*]]..testfile..[[%.swp"]]} + feed('e') -- Chose "Edit" at the swap dialog. + feed('<c-c>') end) end) |