diff options
author | Björn Linse <bjorn.linse@gmail.com> | 2017-08-27 09:57:30 +0200 |
---|---|---|
committer | Björn Linse <bjorn.linse@gmail.com> | 2017-10-26 20:29:10 +0200 |
commit | 91d8e26bc7471378b8005b8843182dc1af90d81a (patch) | |
tree | 5ac1e60e59c8fb7a0ffbe74e9476eafbd88947c4 /test/functional/ui | |
parent | bed0a3a8428027af32602ccb169e81767c55e257 (diff) | |
download | rneovim-91d8e26bc7471378b8005b8843182dc1af90d81a.tar.gz rneovim-91d8e26bc7471378b8005b8843182dc1af90d81a.tar.bz2 rneovim-91d8e26bc7471378b8005b8843182dc1af90d81a.zip |
ext_cmdline: interact with cmdline window
Diffstat (limited to 'test/functional/ui')
-rw-r--r-- | test/functional/ui/cmdline_spec.lua | 107 |
1 files changed, 102 insertions, 5 deletions
diff --git a/test/functional/ui/cmdline_spec.lua b/test/functional/ui/cmdline_spec.lua index e4d625df8e..b886596e00 100644 --- a/test/functional/ui/cmdline_spec.lua +++ b/test/functional/ui/cmdline_spec.lua @@ -232,7 +232,7 @@ describe('external cmdline', function() indent = 0, pos = 3, prompt = "", - }} + }} screen:expect([[ ^ | ~ | @@ -345,19 +345,116 @@ describe('external cmdline', function() end) end) - pending("works with cmdline window", function() - feed(':sign<c-f>') + it("works with cmdline window", function() + feed(':make') + screen:expect([[ + ^ | + ~ | + ~ | + ~ | + | + ]], nil, nil, function() + eq({{ + content = { { {}, "make" } }, + firstc = ":", + indent = 0, + pos = 4, + prompt = "" + }}, cmdline) + end) + + feed('<c-f>') + screen:expect([[ + | + [No Name] | + :make^ | + [Command Line] | + | + ]], nil, nil, function() + eq({}, cmdline) + end) + + -- nested cmdline + feed(':yank') + screen:expect([[ + | + [No Name] | + :make^ | + [Command Line] | + | + ]], nil, nil, function() + eq({nil, { + content = { { {}, "yank" } }, + firstc = ":", + indent = 0, + pos = 4, + prompt = "" + }}, cmdline) + end) + + cmdline = {} + command("redraw!") + screen:expect([[ + | + [No Name] | + :make | + [Command Line] | + ^ | + ]], nil, nil, function() + eq({nil, { + content = { { {}, "yank" } }, + firstc = ":", + indent = 0, + pos = 4, + prompt = "" + }}, cmdline) + end) + + feed("<c-c>") screen:expect([[ | [No Name] | - :sign^ | + :make^ | [Command Line] | | ]], nil, nil, function() eq({}, cmdline) end) - feed(":blargh") + feed("<c-c>") + screen:expect([[ + | + [No Name] | + :make^ | + [Command Line] | + | + ]], nil, nil, function() + eq({{ + content = { { {}, "make" } }, + firstc = ":", + indent = 0, + pos = 4, + prompt = "" + }}, cmdline) + end) + + cmdline = {} + command("redraw!") + screen:expect([[ + | + ~ | + ~ | + ~ | + ^ | + ]], nil, nil, function() + eq({{ + content = { { {}, "make" } }, + firstc = ":", + indent = 0, + pos = 4, + prompt = "" + }}, cmdline) + end) end) it('works with highlighted cmdline', function() |