test: remove unnecessary nil argument to testutil (#28270)

This commit is contained in:
zeertzjq
2024-04-11 08:51:06 +08:00
committed by GitHub
parent 509c053161
commit 4528a69c87
9 changed files with 9 additions and 10 deletions

View File

@@ -1,4 +1,4 @@
local t = require('test.functional.testutil')(nil)
local t = require('test.functional.testutil')()
local clear = t.clear
local exec_lua = t.exec_lua

View File

@@ -1,7 +1,7 @@
-- Modules loaded here will NOT be cleared and reloaded by Busted.
-- Busted started doing this to help provide more isolation. See issue #62
-- for more information about this.
local t = require('test.functional.testutil')(nil)
local t = require('test.functional.testutil')()
require('test.functional.ui.screen')
local is_os = t.is_os

View File

@@ -28,7 +28,7 @@ local function runx(sync, handler, on_setup)
local function setup_cb(...)
on_setup(...)
-- need to stop on setup callback because there's two session:request
-- calls in `request/t.lua`. The second call will always return
-- calls in `request/testutil.lua`. The second call will always return
-- after pending notification/request callbacks are processed
stop()
end

View File

@@ -1,4 +1,4 @@
local t = require('test.functional.testutil')(nil)
local t = require('test.functional.testutil')()
local api = t.api
local write_file = t.write_file
local concat_tables = t.concat_tables

View File

@@ -1,7 +1,7 @@
-- To test tui/input.c, this module spawns `nvim` inside :terminal and sends
-- bytes via jobsend(). Note: the functional/t.lua test-session methods
-- bytes via jobsend(). Note: the functional/testutil.lua test-session methods
-- operate on the _host_ session, _not_ the child session.
local t = require('test.functional.testutil')(nil)
local t = require('test.functional.testutil')()
local Screen = require('test.functional.ui.screen')
local testprg = t.testprg
local exec_lua = t.exec_lua

View File

@@ -1042,7 +1042,6 @@ return function()
before_each(function()
local id = ('T%d'):format(testid())
_G._nvim_test_id = id
return nil, true
end)
end

View File

@@ -233,7 +233,7 @@ describe('--embed UI', function()
}
eq({ [16777215] = true }, seen)
-- NB: by accident how functional/t.lua currently handles the default color scheme, the
-- NB: by accident how functional/testutil.lua currently handles the default color scheme, the
-- above is sufficient to test the behavior. But in case that workaround is removed, we need
-- a test with an explicit override like below, so do it to remain safe.
startup('--cmd', 'hi NORMAL guibg=#FF00FF')

View File

@@ -81,7 +81,7 @@ describe('shell command :!', function()
{3:-- TERMINAL --} |
]],
{
-- test/functional/t.lua defaults to background=light.
-- test/functional/testutil.lua defaults to background=light.
[1] = { reverse = true },
[3] = { bold = true },
[10] = { foreground = 2 },

View File

@@ -70,7 +70,7 @@
-- To help write screen tests, see Screen:snapshot_util().
-- To debug screen tests, see Screen:redraw_debug().
local t = require('test.functional.testutil')(nil)
local t = require('test.functional.testutil')()
local busted = require('busted')
local deepcopy = vim.deepcopy
local shallowcopy = t.shallowcopy