diff options
author | bfredl <bjorn.linse@gmail.com> | 2024-11-11 22:15:19 +0100 |
---|---|---|
committer | bfredl <bjorn.linse@gmail.com> | 2024-11-14 12:40:57 +0100 |
commit | e61228a214ebda9845db9462dad0a8c362d3963f (patch) | |
tree | fc5908c85c0cc6affc3bc325cd75f6efaeea95d8 /test/functional/vimscript/has_spec.lua | |
parent | 40dee8a2dcba996badaa6182eb34fde1694f92a3 (diff) | |
download | rneovim-e61228a214ebda9845db9462dad0a8c362d3963f.tar.gz rneovim-e61228a214ebda9845db9462dad0a8c362d3963f.tar.bz2 rneovim-e61228a214ebda9845db9462dad0a8c362d3963f.zip |
fix(tests): needing two calls to setup a screen is cringe
Before calling "attach" a screen object is just a dummy container for
(row, col) values whose purpose is to be sent as part of the "attach"
function call anyway.
Just create the screen in an attached state directly. Keep the complete
(row, col, options) config together. It is still completely valid to
later detach and re-attach as needed, including to another session.
Diffstat (limited to 'test/functional/vimscript/has_spec.lua')
-rw-r--r-- | test/functional/vimscript/has_spec.lua | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/test/functional/vimscript/has_spec.lua b/test/functional/vimscript/has_spec.lua index 1d2187be6b..ff90edfe30 100644 --- a/test/functional/vimscript/has_spec.lua +++ b/test/functional/vimscript/has_spec.lua @@ -4,6 +4,7 @@ local Screen = require('test.functional.ui.screen') local clear = n.clear local connect = n.connect +local get_session = n.get_session local eq = t.eq local fn = n.fn local is_os = t.is_os @@ -74,12 +75,12 @@ describe('has()', function() it('"gui_running"', function() eq(0, fn.has('gui_running')) - local tui = Screen.new(50, 15) + local tui_session = get_session() local gui_session = connect(fn.serverstart()) - local gui = Screen.new(50, 15) eq(0, fn.has('gui_running')) - tui:attach({ ext_linegrid = true, rgb = true, stdin_tty = true, stdout_tty = true }) - gui:attach({ ext_multigrid = true, rgb = true }, gui_session) + local tui = Screen.new(50, 5, { rgb = true, stdin_tty = true, stdout_tty = true }, tui_session) + eq(0, fn.has('gui_running')) + local gui = Screen.new(50, 15, { ext_multigrid = true, rgb = true }, gui_session) eq(1, fn.has('gui_running')) tui:detach() eq(1, fn.has('gui_running')) |