diff options
author | Björn Linse <bjorn.linse@gmail.com> | 2018-06-02 10:03:43 +0200 |
---|---|---|
committer | Björn Linse <bjorn.linse@gmail.com> | 2018-06-02 10:07:07 +0200 |
commit | 37e00c6e656435c8b58d442aa5853c94a76cabca (patch) | |
tree | a640cb21d56ed345a97fa78dafe32779ae2aca92 /test/functional/ex_cmds/debug_spec.lua | |
parent | 1efe65a1557268496cb0431edce5010fe0a91565 (diff) | |
download | rneovim-37e00c6e656435c8b58d442aa5853c94a76cabca.tar.gz rneovim-37e00c6e656435c8b58d442aa5853c94a76cabca.tar.bz2 rneovim-37e00c6e656435c8b58d442aa5853c94a76cabca.zip |
ex_getln: remove msg_scrolled cargo-cult magic, fixes #8251
Diffstat (limited to 'test/functional/ex_cmds/debug_spec.lua')
-rw-r--r-- | test/functional/ex_cmds/debug_spec.lua | 110 |
1 files changed, 110 insertions, 0 deletions
diff --git a/test/functional/ex_cmds/debug_spec.lua b/test/functional/ex_cmds/debug_spec.lua new file mode 100644 index 0000000000..5dad8098ea --- /dev/null +++ b/test/functional/ex_cmds/debug_spec.lua @@ -0,0 +1,110 @@ +local helpers = require('test.functional.helpers')(after_each) +local Screen = require('test.functional.ui.screen') +local feed = helpers.feed +local clear = helpers.clear + +describe(':debug', function() + local screen + before_each(function() + clear() + screen = Screen.new(50, 14) + screen:set_default_attr_ids({ + [1] = {bold = true, foreground = Screen.colors.Blue1}, + [2] = {bold = true, reverse = true}, + [3] = {foreground = Screen.colors.Grey100, background = Screen.colors.Red}, + [4] = {bold = true, foreground = Screen.colors.SeaGreen4}, + }) + screen:attach() + end) + 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}^ | + ]]) + + 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" | + >^ | + ]]) + + 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" | + >^ | + ]]) + + 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}^ | + ]]) + + feed('<cr>') + screen:expect([[ + ^ | + {1:~ }| + {1:~ }| + {1:~ }| + {1:~ }| + {1:~ }| + {1:~ }| + {1:~ }| + {1:~ }| + {1:~ }| + {1:~ }| + {1:~ }| + {1:~ }| + | + ]]) + end) +end) |