aboutsummaryrefslogtreecommitdiff
path: root/test/functional/eval
diff options
context:
space:
mode:
Diffstat (limited to 'test/functional/eval')
-rw-r--r--test/functional/eval/buf_functions_spec.lua6
-rw-r--r--test/functional/eval/input_spec.lua2
-rw-r--r--test/functional/eval/let_spec.lua15
-rw-r--r--test/functional/eval/null_spec.lua6
-rw-r--r--test/functional/eval/sort_spec.lua3
-rw-r--r--test/functional/eval/uniq_spec.lua2
6 files changed, 25 insertions, 9 deletions
diff --git a/test/functional/eval/buf_functions_spec.lua b/test/functional/eval/buf_functions_spec.lua
index 37f4c89bfd..06841a4521 100644
--- a/test/functional/eval/buf_functions_spec.lua
+++ b/test/functional/eval/buf_functions_spec.lua
@@ -31,10 +31,12 @@ for _, func in ipairs({'bufname(%s)', 'bufnr(%s)', 'bufwinnr(%s)',
it('errors out when receives v:true/v:false/v:null', function()
-- Not compatible with Vim: in Vim it always results in buffer not found
-- without any error messages.
- for _, var in ipairs({'v:true', 'v:false', 'v:null'}) do
- eq('Vim(call):E5300: Expected a Number or a String',
+ for _, var in ipairs({'v:true', 'v:false'}) do
+ eq('Vim(call):E5299: Expected a Number or a String, Boolean found',
exc_exec('call ' .. func:format(var)))
end
+ eq('Vim(call):E5300: Expected a Number or a String',
+ exc_exec('call ' .. func:format('v:null')))
end)
it('errors out when receives invalid argument', function()
eq('Vim(call):E745: Expected a Number or a String, List found',
diff --git a/test/functional/eval/input_spec.lua b/test/functional/eval/input_spec.lua
index e774b939f7..14c02f9eb2 100644
--- a/test/functional/eval/input_spec.lua
+++ b/test/functional/eval/input_spec.lua
@@ -462,7 +462,7 @@ describe('confirm()', function()
-- With shortmess-=F
command('set shortmess-=F')
feed(':edit foo<cr>')
- check_and_clear('"foo" [New File] |\n')
+ check_and_clear('"foo" [New] |\n')
-- With shortmess+=F
command('set shortmess+=F')
diff --git a/test/functional/eval/let_spec.lua b/test/functional/eval/let_spec.lua
index f8fcdfd41f..5bc703b567 100644
--- a/test/functional/eval/let_spec.lua
+++ b/test/functional/eval/let_spec.lua
@@ -75,4 +75,19 @@ describe(':let', function()
command(cmd_get_child_env)
eq(eval('$NVIM_TEST'), eval('g:env_from_child'))
end)
+
+ it("release of list assigned to l: variable does not trigger assertion #12387, #12430", function()
+ source([[
+ func! s:f()
+ let l:x = [1]
+ let g:x = l:
+ endfunc
+ for _ in range(2)
+ call s:f()
+ endfor
+ call garbagecollect()
+ call feedkeys('i', 't')
+ ]])
+ eq(1, eval('1'))
+ end)
end)
diff --git a/test/functional/eval/null_spec.lua b/test/functional/eval/null_spec.lua
index afe999e1fa..db0a706319 100644
--- a/test/functional/eval/null_spec.lua
+++ b/test/functional/eval/null_spec.lua
@@ -47,10 +47,8 @@ describe('NULL', function()
-- Subjectable behaviour
- -- FIXME Should return 1
- null_expr_test('is equal to empty list', 'L == []', 0, 0)
- -- FIXME Should return 1
- null_expr_test('is equal to empty list (reverse order)', '[] == L', 0, 0)
+ null_expr_test('is equal to empty list', 'L == []', 0, 1)
+ null_expr_test('is equal to empty list (reverse order)', '[] == L', 0, 1)
-- Correct behaviour
null_expr_test('can be indexed with error message for empty list', 'L[0]',
diff --git a/test/functional/eval/sort_spec.lua b/test/functional/eval/sort_spec.lua
index 82557575ce..e1cc2c2924 100644
--- a/test/functional/eval/sort_spec.lua
+++ b/test/functional/eval/sort_spec.lua
@@ -14,7 +14,7 @@ before_each(clear)
describe('sort()', function()
it('errors out when sorting special values', function()
- eq('Vim(call):E907: Using a special value as a Float',
+ eq('Vim(call):E362: Using a boolean value as a Float',
exc_exec('call sort([v:true, v:false], "f")'))
end)
@@ -30,6 +30,7 @@ describe('sort()', function()
errors[err] = true
end
eq({
+ ['E362: Using a boolean value as a Float']=true,
['E891: Using a Funcref as a Float']=true,
['E892: Using a String as a Float']=true,
['E893: Using a List as a Float']=true,
diff --git a/test/functional/eval/uniq_spec.lua b/test/functional/eval/uniq_spec.lua
index 0e7a013e32..5cdba0a0f6 100644
--- a/test/functional/eval/uniq_spec.lua
+++ b/test/functional/eval/uniq_spec.lua
@@ -11,7 +11,7 @@ before_each(clear)
describe('uniq()', function()
it('errors out when processing special values', function()
- eq('Vim(call):E907: Using a special value as a Float',
+ eq('Vim(call):E362: Using a boolean value as a Float',
exc_exec('call uniq([v:true, v:false], "f")'))
end)