vim-patch:8.1.1336: some eval functionality is not covered by tests

Problem:    Some eval functionality is not covered by tests.
Solution:   Add a few more test cases. (Masato Nishihata, closes vim/vim#4374)
17aca707f9

Test_expand() changes are required for v8.1.1921.
Test_call() and Test_cindent_func() are already ported.
This commit is contained in:
Sean Dewar
2021-08-27 22:07:34 +01:00
parent 7ba11e06c0
commit 0193b3a391
7 changed files with 40 additions and 12 deletions

View File

@@ -1,6 +1,7 @@
local helpers = require('test.functional.helpers')(after_each)
local clear, source = helpers.clear, helpers.source
local eq, eval, command = helpers.eq, helpers.eval, helpers.command
local exc_exec = helpers.exc_exec
describe('Test for delete()', function()
before_each(clear)
@@ -114,4 +115,10 @@ describe('Test for delete()', function()
eq(0, eval("delete('Xdir4/Xfile')"))
eq(0, eval("delete('Xdir4', 'd')"))
end)
it('gives correct emsgs', function()
eq('Vim(call):E474: Invalid argument', exc_exec("call delete('')"))
eq('Vim(call):E15: Invalid expression: 0',
exc_exec("call delete('foo', 0)"))
end)
end)