aboutsummaryrefslogtreecommitdiff
path: root/test/functional/ui/screen_basic_spec.lua
diff options
context:
space:
mode:
authorJustin M. Keyes <justinkz@gmail.com>2025-01-04 16:48:00 -0800
committerGitHub <noreply@github.com>2025-01-04 16:48:00 -0800
commit64b0e6582ae8c273efbe39109bcb261079c2bcd4 (patch)
tree2e9de1f2224814dc10af8c5ef338e3aaa974f181 /test/functional/ui/screen_basic_spec.lua
parenta8ace2c58a318552869462a36859aabf1cdfaa68 (diff)
downloadrneovim-64b0e6582ae8c273efbe39109bcb261079c2bcd4.tar.gz
rneovim-64b0e6582ae8c273efbe39109bcb261079c2bcd4.tar.bz2
rneovim-64b0e6582ae8c273efbe39109bcb261079c2bcd4.zip
refactor(tests): merge n.spawn/n.spawn_argv into n.new_session #31859
Problem: - `n.spawn()` is misleading because it also connects RPC, it's not just "spawning" a process. - It's confusing that `n.spawn()` and `n.spawn_argv()` are separate. Solution: - Replace `n.spawn()`/`n.spawn_argv()` with a single function `n.new_session()`. This name aligns with the existing functions `n.set_session`/`n.get_session`. - Note: removes direct handling of `prepend_argv`, but I doubt that was important or intentional. If callers want to control use of `prepend_argv` then we should add a new flag to `test.session.Opts`. - Move `keep` to first parameter of `n.new_session()`. - Add a `merge` flag to `test.session.Opts` - Mark `_new_argv()` as private. Test should use clear/new_session/spawn_wait instead.
Diffstat (limited to 'test/functional/ui/screen_basic_spec.lua')
-rw-r--r--test/functional/ui/screen_basic_spec.lua6
1 files changed, 3 insertions, 3 deletions
diff --git a/test/functional/ui/screen_basic_spec.lua b/test/functional/ui/screen_basic_spec.lua
index 666d98c3b2..295c40b9b6 100644
--- a/test/functional/ui/screen_basic_spec.lua
+++ b/test/functional/ui/screen_basic_spec.lua
@@ -2,7 +2,7 @@ local t = require('test.testutil')
local n = require('test.functional.testnvim')()
local Screen = require('test.functional.ui.screen')
-local spawn, set_session, clear = n.spawn, n.set_session, n.clear
+local set_session, clear = n.set_session, n.clear
local feed, command = n.feed, n.command
local exec = n.exec
local insert = n.insert
@@ -26,7 +26,7 @@ describe('screen', function()
}
before_each(function()
- local screen_nvim = spawn(nvim_argv)
+ local screen_nvim = n.new_session(false, { args = nvim_argv, merge = false })
set_session(screen_nvim)
screen = Screen.new()
end)
@@ -766,7 +766,7 @@ describe('Screen default colors', function()
'colorscheme vim',
'--embed',
}
- local screen_nvim = spawn(nvim_argv)
+ local screen_nvim = n.new_session(false, { args = nvim_argv, merge = false })
set_session(screen_nvim)
screen = Screen.new(53, 14, { rgb = true, ext_termcolors = termcolors or nil })
end