refactor(test): inject after_each differently

This commit is contained in:
Lewis Russell 2024-04-09 12:26:16 +01:00 committed by Lewis Russell
parent 889f81c65f
commit 81fc27124b
473 changed files with 478 additions and 476 deletions

View File

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

View File

@ -1,6 +1,6 @@
-- Test for benchmarking the RE engine.
local t = require('test.functional.testutil')(after_each)
local t = require('test.functional.testutil')()
local insert, source = t.insert, t.source
local clear, command = t.clear, t.command

View File

@ -1,4 +1,4 @@
local t = require('test.functional.testutil')(after_each)
local t = require('test.functional.testutil')()
local api = t.api
local Screen = require('test.functional.ui.screen')

View File

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

View File

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

View File

@ -1,4 +1,4 @@
local t = require('test.functional.testutil')(after_each)
local t = require('test.functional.testutil')()
local Screen = require('test.functional.ui.screen')
local clear = t.clear
local eq = t.eq

View File

@ -1,4 +1,4 @@
local t = require('test.functional.testutil')(after_each)
local t = require('test.functional.testutil')()
local clear = t.clear
local eq, ok = t.eq, t.ok
local fn = t.fn

View File

@ -1,4 +1,4 @@
local t = require('test.functional.testutil')(after_each)
local t = require('test.functional.testutil')()
local NIL = vim.NIL
local clear = t.clear

View File

@ -1,4 +1,4 @@
local t = require('test.functional.testutil')(after_each)
local t = require('test.functional.testutil')()
local Screen = require('test.functional.ui.screen')
local request = t.request

View File

@ -1,4 +1,4 @@
local t = require('test.functional.testutil')(after_each)
local t = require('test.functional.testutil')()
local clear = t.clear
local Screen = require('test.functional.ui.screen')
local eq, eval = t.eq, t.eval

View File

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

View File

@ -1,4 +1,4 @@
local t = require('test.functional.testutil')(after_each)
local t = require('test.functional.testutil')()
local Screen = require('test.functional.ui.screen')
local clear = t.clear

View File

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

View File

@ -1,4 +1,4 @@
local t = require('test.functional.testutil')(after_each)
local t = require('test.functional.testutil')()
local assert_log = t.assert_log
local eq, clear, eval, command, next_msg = t.eq, t.clear, t.eval, t.command, t.next_msg
local api = t.api

View File

@ -1,6 +1,6 @@
-- Test server -> client RPC scenarios. Note: unlike `rpcnotify`, to evaluate
-- `rpcrequest` calls we need the client event loop to be running.
local t = require('test.functional.testutil')(after_each)
local t = require('test.functional.testutil')()
local clear, eval = t.clear, t.eval
local eq, neq, run, stop = t.eq, t.neq, t.run, t.stop

View File

@ -1,4 +1,4 @@
local t = require('test.functional.testutil')(after_each)
local t = require('test.functional.testutil')()
local clear, eq, ok = t.clear, t.eq, t.ok
local exec = t.exec
local feed = t.feed

View File

@ -1,4 +1,4 @@
local t = require('test.functional.testutil')(after_each)
local t = require('test.functional.testutil')()
local Screen = require('test.functional.ui.screen')
local clear = t.clear
local command = t.command

View File

@ -1,4 +1,4 @@
local t = require('test.functional.testutil')(after_each)
local t = require('test.functional.testutil')()
local clear, fn, eq = t.clear, t.fn, t.eq
local api = t.api

View File

@ -1,4 +1,4 @@
local t = require('test.functional.testutil')(after_each)
local t = require('test.functional.testutil')()
local Screen = require('test.functional.ui.screen')
local uv = vim.uv

View File

@ -1,4 +1,4 @@
local t = require('test.functional.testutil')(after_each)
local t = require('test.functional.testutil')()
local Screen = require('test.functional.ui.screen')
local clear, curbuf, curbuf_contents, curwin, eq, neq, matches, ok, feed, insert, eval =
t.clear,

View File

@ -1,4 +1,4 @@
local t = require('test.functional.testutil')(after_each)
local t = require('test.functional.testutil')()
local Screen = require('test.functional.ui.screen')
local clear = t.clear

View File

@ -1,4 +1,4 @@
local t = require('test.functional.testutil')(after_each)
local t = require('test.functional.testutil')()
local Screen = require('test.functional.ui.screen')
local assert_visible = t.assert_visible

View File

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

View File

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

View File

@ -1,4 +1,4 @@
local t = require('test.functional.testutil')(after_each)
local t = require('test.functional.testutil')()
local Screen = require('test.functional.ui.screen')
local clear = t.clear

View File

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

View File

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

View File

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

View File

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

View File

@ -1,4 +1,4 @@
local t = require('test.functional.testutil')(after_each)
local t = require('test.functional.testutil')()
local tt = require('test.functional.terminal.testutil')
local clear = t.clear
local feed_command = t.feed_command

View File

@ -1,4 +1,4 @@
local t = require('test.functional.testutil')(after_each)
local t = require('test.functional.testutil')()
local clear, eval, eq = t.clear, t.eval, t.eq
local feed, command = t.feed, t.command
local exec_lua = t.exec_lua

View File

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

View File

@ -1,4 +1,4 @@
local t = require('test.functional.testutil')(after_each)
local t = require('test.functional.testutil')()
local clear = t.clear
local eq = t.eq
local exec = t.exec

View File

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

View File

@ -1,4 +1,4 @@
local t = require('test.functional.testutil')(after_each)
local t = require('test.functional.testutil')()
local Screen = require('test.functional.ui.screen')
local clear = t.clear

View File

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

View File

@ -1,4 +1,4 @@
local t = require('test.functional.testutil')(after_each)
local t = require('test.functional.testutil')()
local clear, eq = t.clear, t.eq
local api = t.api
local command = t.command

View File

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

View File

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

View File

@ -1,5 +1,5 @@
local uv = vim.uv
local t = require('test.functional.testutil')(after_each)
local t = require('test.functional.testutil')()
local tt = require('test.functional.terminal.testutil')
local clear, command, testprg = t.clear, t.command, t.testprg

View File

@ -1,4 +1,4 @@
local t = require('test.functional.testutil')(after_each)
local t = require('test.functional.testutil')()
local clear = t.clear
local exec = t.exec
local command = t.command

View File

@ -1,4 +1,4 @@
local t = require('test.functional.testutil')(after_each)
local t = require('test.functional.testutil')()
local clear, eval, eq = t.clear, t.eval, t.eq
local feed, command, expect = t.feed, t.command, t.expect
local api, fn, neq = t.api, t.fn, t.neq

View File

@ -1,4 +1,4 @@
local t = require('test.functional.testutil')(after_each)
local t = require('test.functional.testutil')()
local Screen = require('test.functional.ui.screen')
local clear = t.clear

View File

@ -1,4 +1,4 @@
local t = require('test.functional.testutil')(after_each)
local t = require('test.functional.testutil')()
local clear, eq, eval, next_msg, ok, source = t.clear, t.eq, t.eval, t.next_msg, t.ok, t.source
local command, fn, api = t.command, t.fn, t.api
local matches = t.matches

View File

@ -1,4 +1,4 @@
local t = require('test.functional.testutil')(after_each)
local t = require('test.functional.testutil')()
local assert_alive = t.assert_alive
local command = t.command

View File

@ -1,5 +1,5 @@
local uv = vim.uv
local t = require('test.functional.testutil')(after_each)
local t = require('test.functional.testutil')()
local assert_log = t.assert_log
local assert_nolog = t.assert_nolog

View File

@ -1,4 +1,4 @@
local t = require('test.functional.testutil')(after_each)
local t = require('test.functional.testutil')()
local tt = require('test.functional.terminal.testutil')
local clear = t.clear

View File

@ -1,4 +1,4 @@
local t = require('test.functional.testutil')(after_each)
local t = require('test.functional.testutil')()
local assert_log = t.assert_log
local clear = t.clear
local command = t.command

View File

@ -1,5 +1,5 @@
local uv = vim.uv
local t = require('test.functional.testutil')(after_each)
local t = require('test.functional.testutil')()
local Screen = require('test.functional.ui.screen')
local eq = t.eq

View File

@ -1,4 +1,4 @@
local t = require('test.functional.testutil')(after_each)
local t = require('test.functional.testutil')()
local clear = t.clear
local command = t.command
local eq = t.eq

View File

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

View File

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

View File

@ -1,4 +1,4 @@
local t = require('test.functional.testutil')(after_each)
local t = require('test.functional.testutil')()
local Screen = require('test.functional.ui.screen')
local assert_alive = t.assert_alive

View File

@ -1,4 +1,4 @@
local t = require('test.functional.testutil')(after_each)
local t = require('test.functional.testutil')()
local eq, clear, eval, feed, api, retry = t.eq, t.clear, t.eval, t.feed, t.api, t.retry
describe('K', function()

View File

@ -1,4 +1,4 @@
local t = require('test.functional.testutil')(after_each)
local t = require('test.functional.testutil')()
local Screen = require('test.functional.ui.screen')
local assert_alive = t.assert_alive
local clear, feed = t.clear, t.feed

View File

@ -1,4 +1,4 @@
local t = require('test.functional.testutil')(after_each)
local t = require('test.functional.testutil')()
local eq = t.eq
local eval = t.eval

View File

@ -1,4 +1,4 @@
local t = require('test.functional.testutil')(after_each)
local t = require('test.functional.testutil')()
local Screen = require('test.functional.ui.screen')
local clear, feed, source = t.clear, t.feed, t.source
local command = t.command

View File

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

View File

@ -1,4 +1,4 @@
local t = require('test.functional.testutil')(after_each)
local t = require('test.functional.testutil')()
local Screen = require('test.functional.ui.screen')
local clear = t.clear

View File

@ -1,4 +1,4 @@
local t = require('test.functional.testutil')(after_each)
local t = require('test.functional.testutil')()
local clear, insert, eq = t.clear, t.insert, t.eq
local command, expect = t.command, t.expect
local feed, eval = t.feed, t.eval

View File

@ -1,4 +1,4 @@
local t = require('test.functional.testutil')(after_each)
local t = require('test.functional.testutil')()
local eq, neq, call = t.eq, t.neq, t.call
local eval, feed, clear = t.eval, t.feed, t.clear

View File

@ -1,4 +1,4 @@
local t = require('test.functional.testutil')(after_each)
local t = require('test.functional.testutil')()
local eq = t.eq
local eval = t.eval

View File

@ -1,4 +1,4 @@
local t = require('test.functional.testutil')(after_each)
local t = require('test.functional.testutil')()
local Screen = require('test.functional.ui.screen')
local api = t.api
local clear = t.clear

View File

@ -1,4 +1,4 @@
local t = require('test.functional.testutil')(after_each)
local t = require('test.functional.testutil')()
local clear, feed, insert = t.clear, t.feed, t.insert
local command = t.command
local exec_lua = t.exec_lua

View File

@ -1,6 +1,6 @@
-- Cmdline-mode tests.
local t = require('test.functional.testutil')(after_each)
local t = require('test.functional.testutil')()
local Screen = require('test.functional.ui.screen')
local clear, insert, fn, eq, feed = t.clear, t.insert, t.fn, t.eq, t.feed
local eval = t.eval

View File

@ -1,6 +1,6 @@
-- Insert-mode tests.
local t = require('test.functional.testutil')(after_each)
local t = require('test.functional.testutil')()
local Screen = require('test.functional.ui.screen')
local clear, feed, insert = t.clear, t.feed, t.insert
local expect = t.expect

View File

@ -1,6 +1,6 @@
-- Normal mode tests.
local t = require('test.functional.testutil')(after_each)
local t = require('test.functional.testutil')()
local clear = t.clear
local feed = t.feed
local fn = t.fn

View File

@ -1,5 +1,5 @@
local Screen = require('test.functional.ui.screen')
local t = require('test.functional.testutil')(after_each)
local t = require('test.functional.testutil')()
local clear = t.clear
local insert = t.insert

View File

@ -1,4 +1,4 @@
local t = require('test.functional.testutil')(after_each)
local t = require('test.functional.testutil')()
local clear = t.clear
local command = t.command
local eq = t.eq

View File

@ -1,4 +1,4 @@
local t = require('test.functional.testutil')(after_each)
local t = require('test.functional.testutil')()
local Screen = require('test.functional.ui.screen')
local clear = t.clear

View File

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

View File

@ -1,4 +1,4 @@
local t = require('test.functional.testutil')(after_each)
local t = require('test.functional.testutil')()
local eq = t.eq
local dedent = t.dedent

View File

@ -1,4 +1,4 @@
local t = require('test.functional.testutil')(after_each)
local t = require('test.functional.testutil')()
local eq, command, fn = t.eq, t.command, t.fn
local ok = t.ok
local matches = t.matches

View File

@ -1,6 +1,6 @@
-- Specs for :cd, :tcd, :lcd and getcwd()
local t = require('test.functional.testutil')(after_each)
local t = require('test.functional.testutil')()
local eq = t.eq
local call = t.call

View File

@ -1,4 +1,4 @@
local t = require('test.functional.testutil')(after_each)
local t = require('test.functional.testutil')()
local clear = t.clear
local feed = t.feed
local eq = t.eq

View File

@ -1,4 +1,4 @@
local t = require('test.functional.testutil')(after_each)
local t = require('test.functional.testutil')()
local Screen = require('test.functional.ui.screen')
local feed = t.feed
local clear = t.clear

View File

@ -1,4 +1,4 @@
local t = require('test.functional.testutil')(after_each)
local t = require('test.functional.testutil')()
local assert_alive = t.assert_alive
local clear, source = t.clear, t.source
local api = t.api

View File

@ -1,4 +1,4 @@
local t = require('test.functional.testutil')(after_each)
local t = require('test.functional.testutil')()
local clear = t.clear
local command = t.command
local feed = t.feed

View File

@ -1,4 +1,4 @@
local t = require('test.functional.testutil')(after_each)
local t = require('test.functional.testutil')()
local command = t.command
local Screen = require('test.functional.ui.screen')
local clear, feed, feed_command = t.clear, t.feed, t.feed_command

View File

@ -1,4 +1,4 @@
local t = require('test.functional.testutil')(after_each)
local t = require('test.functional.testutil')()
local eq = t.eq
local NIL = vim.NIL

View File

@ -1,4 +1,4 @@
local t = require('test.functional.testutil')(after_each)
local t = require('test.functional.testutil')()
local eq, command, fn = t.eq, t.command, t.fn
local ok = t.ok
local matches = t.matches

View File

@ -1,4 +1,4 @@
local t = require('test.functional.testutil')(after_each)
local t = require('test.functional.testutil')()
local clear, feed_command, feed = t.clear, t.feed_command, t.feed
local eq, neq, eval = t.eq, t.neq, t.eval

View File

@ -1,4 +1,4 @@
local t = require('test.functional.testutil')(after_each)
local t = require('test.functional.testutil')()
local command = t.command
local eq = t.eq
local clear = t.clear

View File

@ -1,4 +1,4 @@
local t = require('test.functional.testutil')(after_each)
local t = require('test.functional.testutil')()
local clear = t.clear
local command = t.command
local eq = t.eq

View File

@ -1,4 +1,4 @@
local t = require('test.functional.testutil')(after_each)
local t = require('test.functional.testutil')()
local clear, feed_command, feed, ok, eval = t.clear, t.feed_command, t.feed, t.ok, t.eval
describe(':grep', function()

View File

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

View File

@ -1,5 +1,5 @@
local Screen = require('test.functional.ui.screen')
local t = require('test.functional.testutil')(after_each)
local t = require('test.functional.testutil')()
local eq, command = t.eq, t.command
local clear = t.clear
local eval, exc_exec = t.eval, t.exc_exec

View File

@ -1,4 +1,4 @@
local t = require('test.functional.testutil')(after_each)
local t = require('test.functional.testutil')()
local clear = t.clear
local command = t.command
local eq = t.eq

View File

@ -1,4 +1,4 @@
local t = require('test.functional.testutil')(after_each)
local t = require('test.functional.testutil')()
local clear = t.clear
local eval = t.eval
local has_powershell = t.has_powershell

View File

@ -1,4 +1,4 @@
local t = require('test.functional.testutil')(after_each)
local t = require('test.functional.testutil')()
local Screen = require('test.functional.ui.screen')
local eq = t.eq

View File

@ -1,4 +1,4 @@
local t = require('test.functional.testutil')(after_each)
local t = require('test.functional.testutil')()
local clear, command = t.clear, t.command
local expect, feed = t.expect, t.feed
local eq, eval = t.eq, t.eval

View File

@ -1,4 +1,4 @@
local t = require('test.functional.testutil')(after_each)
local t = require('test.functional.testutil')()
local Screen = require('test.functional.ui.screen')
local clear = t.clear

View File

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

View File

@ -1,4 +1,4 @@
local t = require('test.functional.testutil')(after_each)
local t = require('test.functional.testutil')()
local clear = t.clear
local command = t.command
local fn = t.fn

View File

@ -1,5 +1,5 @@
local Screen = require('test.functional.ui.screen')
local t = require('test.functional.testutil')(after_each)
local t = require('test.functional.testutil')()
local clear = t.clear
local command = t.command

View File

@ -1,4 +1,4 @@
local t = require('test.functional.testutil')(after_each)
local t = require('test.functional.testutil')()
local clear, eq, command, fn = t.clear, t.eq, t.command, t.fn
describe(':z^', function()

View File

@ -1,7 +1,7 @@
require('os')
local uv = vim.uv
local t = require('test.functional.testutil')(after_each)
local t = require('test.functional.testutil')()
local eval = t.eval
local command = t.command
local eq, neq = t.eq, t.neq

View File

@ -1,4 +1,4 @@
local t = require('test.functional.testutil')(after_each)
local t = require('test.functional.testutil')()
local Screen = require('test.functional.ui.screen')
local feed = t.feed

View File

@ -1,4 +1,4 @@
local t = require('test.functional.testutil')(after_each)
local t = require('test.functional.testutil')()
local clear = t.clear
describe(':qa', function()

View File

@ -1,4 +1,4 @@
local t = require('test.functional.testutil')(after_each)
local t = require('test.functional.testutil')()
local eq = t.eq
local neq = t.neq

Some files were not shown because too many files have changed in this diff Show More