mirror of
https://github.com/neovim/neovim.git
synced 2026-08-30 02:51:48 +00:00
test: improve test conventions
Work on https://github.com/neovim/neovim/issues/27004.
This commit is contained in:
@@ -1,11 +1,11 @@
|
||||
local helpers = require('test.functional.helpers')(after_each)
|
||||
local clear = helpers.clear
|
||||
local command = helpers.command
|
||||
local eq = helpers.eq
|
||||
local pathsep = helpers.get_pathsep()
|
||||
local fn = helpers.fn
|
||||
local api = helpers.api
|
||||
local exec_lua = helpers.exec_lua
|
||||
local t = require('test.functional.testutil')(after_each)
|
||||
local clear = t.clear
|
||||
local command = t.command
|
||||
local eq = t.eq
|
||||
local pathsep = t.get_pathsep()
|
||||
local fn = t.fn
|
||||
local api = t.api
|
||||
local exec_lua = t.exec_lua
|
||||
|
||||
local testdir = 'Xtest-editorconfig'
|
||||
|
||||
@@ -20,8 +20,8 @@ local function test_case(name, expected)
|
||||
end
|
||||
|
||||
setup(function()
|
||||
helpers.mkdir_p(testdir)
|
||||
helpers.write_file(
|
||||
t.mkdir_p(testdir)
|
||||
t.write_file(
|
||||
testdir .. pathsep .. '.editorconfig',
|
||||
[[
|
||||
root = true
|
||||
@@ -96,7 +96,7 @@ setup(function()
|
||||
end)
|
||||
|
||||
teardown(function()
|
||||
helpers.rmdir(testdir)
|
||||
t.rmdir(testdir)
|
||||
end)
|
||||
|
||||
describe('editorconfig', function()
|
||||
@@ -178,18 +178,18 @@ But not this one
|
||||
-- luacheck: pop
|
||||
local trimmed = untrimmed:gsub('%s+\n', '\n')
|
||||
|
||||
helpers.write_file(filename, untrimmed)
|
||||
t.write_file(filename, untrimmed)
|
||||
command('edit ' .. filename)
|
||||
command('write')
|
||||
command('bdelete')
|
||||
eq(trimmed, helpers.read_file(filename))
|
||||
eq(trimmed, t.read_file(filename))
|
||||
|
||||
filename = testdir .. pathsep .. 'no_trim.txt'
|
||||
helpers.write_file(filename, untrimmed)
|
||||
t.write_file(filename, untrimmed)
|
||||
command('edit ' .. filename)
|
||||
command('write')
|
||||
command('bdelete')
|
||||
eq(untrimmed, helpers.read_file(filename))
|
||||
eq(untrimmed, t.read_file(filename))
|
||||
end)
|
||||
|
||||
it('sets textwidth', function()
|
||||
|
||||
Reference in New Issue
Block a user