mirror of
https://github.com/neovim/neovim.git
synced 2026-05-04 13:05:05 +00:00
feat(test): use nvim_exec in helpers.source() #16064
helpers.source() was a hack to work around the lack of anonymous :source. Its "create tempfile" behavior is not a required part of most tests that use it. Some tests still need the old "create tempfile" behavior either because they test SID behavior, or because of missing nvim_exec features: #16071
This commit is contained in:
@@ -136,19 +136,19 @@ describe('assert function:', function()
|
||||
end)
|
||||
|
||||
it('should have file names and passed messages', function()
|
||||
local tmpname_one = source([[
|
||||
source([[
|
||||
call assert_equal(1, 100, 'equal assertion failed')
|
||||
call assert_false('true', 'true assertion failed')
|
||||
call assert_true('false', 'false assertion failed')
|
||||
]])
|
||||
local tmpname_two = source([[
|
||||
source([[
|
||||
call assert_true('', 'file two')
|
||||
]])
|
||||
expected_errors({
|
||||
tmpname_one .. " line 1: equal assertion failed: Expected 1 but got 100",
|
||||
tmpname_one .. " line 2: true assertion failed: Expected False but got 'true'",
|
||||
tmpname_one .. " line 3: false assertion failed: Expected True but got 'false'",
|
||||
tmpname_two .. " line 1: file two: Expected True but got ''",
|
||||
"nvim_exec(): equal assertion failed: Expected 1 but got 100",
|
||||
"nvim_exec(): true assertion failed: Expected False but got 'true'",
|
||||
"nvim_exec(): false assertion failed: Expected True but got 'false'",
|
||||
"nvim_exec(): file two: Expected True but got ''",
|
||||
})
|
||||
end)
|
||||
end)
|
||||
|
||||
Reference in New Issue
Block a user