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/core/startup_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/core/startup_spec.lua')
-rw-r--r-- | test/functional/core/startup_spec.lua | 14 |
1 files changed, 1 insertions, 13 deletions
diff --git a/test/functional/core/startup_spec.lua b/test/functional/core/startup_spec.lua index 7f99a4a2eb..e885164c20 100644 --- a/test/functional/core/startup_spec.lua +++ b/test/functional/core/startup_spec.lua @@ -55,7 +55,6 @@ describe('startup', function() clear() local screen screen = Screen.new(84, 3) - screen:attach() fn.termopen({ nvim_prog, '-u', 'NONE', '--server', eval('v:servername'), '--remote-ui' }) screen:expect([[ ^Cannot attach UI of :terminal child to its parent. (Unset $NVIM to skip this check) | @@ -97,7 +96,6 @@ describe('startup', function() clear() local screen screen = Screen.new(60, 7) - screen:attach() -- not the same colors on windows for some reason screen._default_attr_ids = nil local id = fn.termopen({ @@ -346,7 +344,6 @@ describe('startup', function() it('with --embed: has("ttyin")==0 has("ttyout")==0', function() local screen = Screen.new(25, 3) -- Remote UI connected by --embed. - screen:attach() -- TODO: a lot of tests in this file already use the new default color scheme. -- once we do the batch update of tests to use it, remove this workarond screen._default_attr_ids = nil @@ -360,7 +357,6 @@ describe('startup', function() it('in a TTY: has("ttyin")==1 has("ttyout")==1', function() local screen = Screen.new(25, 4) - screen:attach() screen._default_attr_ids = nil if is_os('win') then command([[set shellcmdflag=/s\ /c shellxquote=\"]]) @@ -455,7 +451,6 @@ describe('startup', function() it('input from pipe (implicit) #7679', function() clear({ env = { NVIM_LOG_FILE = testlog } }) local screen = Screen.new(25, 4) - screen:attach() screen._default_attr_ids = nil if is_os('win') then command([[set shellcmdflag=/s\ /c shellxquote=\"]]) @@ -620,7 +615,6 @@ describe('startup', function() it('ENTER dismisses early message #7967', function() local screen screen = Screen.new(60, 6) - screen:attach() screen._default_attr_ids = nil local id = fn.termopen({ nvim_prog, @@ -718,7 +712,6 @@ describe('startup', function() it('-e/-E interactive #7679', function() clear('-e') local screen = Screen.new(25, 3) - screen:attach() feed("put ='from -e'<CR>") screen:expect([[ :put ='from -e' | @@ -728,7 +721,6 @@ describe('startup', function() clear('-E') screen = Screen.new(25, 3) - screen:attach() feed("put ='from -E'<CR>") screen:expect([[ :put ='from -E' | @@ -738,9 +730,8 @@ describe('startup', function() end) it('-e sets ex mode', function() - local screen = Screen.new(25, 3) clear('-e') - screen:attach() + local screen = Screen.new(25, 3) -- Verify we set the proper mode both before and after :vi. feed('put =mode(1)<CR>vi<CR>:put =mode(1)<CR>') screen:expect([[ @@ -792,7 +783,6 @@ describe('startup', function() it("sets 'shortmess' when loading other tabs", function() clear({ args = { '-p', 'a', 'b', 'c' } }) local screen = Screen.new(25, 4) - screen:attach() screen:expect({ grid = [[ {1: a }{2: b c }{3: }{2:X}| @@ -1155,7 +1145,6 @@ describe('user config init', function() eq('---', eval('g:exrc_file')) local screen = Screen.new(50, 8) - screen:attach() screen._default_attr_ids = nil fn.termopen({ nvim_prog }, { env = { @@ -1431,7 +1420,6 @@ describe('inccommand on ex mode', function() clear() local screen screen = Screen.new(60, 10) - screen:attach() local id = fn.termopen({ nvim_prog, '-u', |