aboutsummaryrefslogtreecommitdiff
path: root/test/functional/eval/null_spec.lua
diff options
context:
space:
mode:
authorZyX <kp-pav@yandex.ru>2017-12-10 23:16:00 +0300
committerZyX <kp-pav@yandex.ru>2017-12-10 23:16:00 +0300
commit622d355ab46b4d9282de9db6f25701882dd8f4ab (patch)
tree86c9f1b5e525f69dd2cec5353db27d095813ad6c /test/functional/eval/null_spec.lua
parentd11884db497114bc8ac5e33964ed81165f8a50fe (diff)
downloadrneovim-622d355ab46b4d9282de9db6f25701882dd8f4ab.tar.gz
rneovim-622d355ab46b4d9282de9db6f25701882dd8f4ab.tar.bz2
rneovim-622d355ab46b4d9282de9db6f25701882dd8f4ab.zip
functests: Add some more NULL tests
Diffstat (limited to 'test/functional/eval/null_spec.lua')
-rw-r--r--test/functional/eval/null_spec.lua8
1 files changed, 8 insertions, 0 deletions
diff --git a/test/functional/eval/null_spec.lua b/test/functional/eval/null_spec.lua
index 64be8fcd11..14b2d964d5 100644
--- a/test/functional/eval/null_spec.lua
+++ b/test/functional/eval/null_spec.lua
@@ -40,6 +40,11 @@ describe('NULL', function()
end)
end
describe('list', function()
+ -- Incorrect behaviour
+ -- FIXME Should error out with different message
+ null_test('makes :unlet act as if it is not a list', ':unlet L[0]',
+ 'Vim(unlet):E689: Can only index a List or Dictionary')
+
-- Subjectable behaviour
-- FIXME Should return 1
@@ -48,6 +53,9 @@ describe('NULL', function()
null_expr_test('is equal to empty list (reverse order)', '[] == L', 0, 0)
-- Correct behaviour
+ null_expr_test('can be indexed with error message for empty list', 'L[0]',
+ 'E684: list index out of range: 0\nE15: Invalid expression: L[0]', nil)
+ null_expr_test('can be splice-indexed', 'L[:]', 0, {})
null_expr_test('is not locked', 'islocked("v:_null_list")', 0, 0)
null_test('is accepted by :for', 'for x in L|throw x|endfor', 0)
null_expr_test('does not crash append()', 'append(1, L)', 0, 0, function()