Problem: Error message with :unlet! and non-existing dictionary item
Solution: Set GLV_QUIET when using unlet with bang attribute
fixes: #18516
https://github.com/vim/vim/pull/18734
(2 files)
—
Reply to this email directly, view it on GitHub.
You are receiving this because you are subscribed to this thread.![]()
@yegappan commented on this pull request.
> @@ -1114,4 +1114,17 @@ func Test_bitwise_shift()
call assert_equal(64, MultBy2_A()(32))
endfunc
+func Test_unlet_nonexisting_key()
+ let g:base = {}
+ call assert_fails(':unlet g:base["foobar"]', 'E716:')
+
+ try
+ unlet! g:base["foobar"]
+ catch
+ call assert_false(1, "no error when unletting non-existing dict key")
Can you use assert_report() here?
—
Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you are subscribed to this thread.![]()
@chrisbra pushed 1 commit.
—
View it on GitHub or unsubscribe.
You are receiving this because you are subscribed to this thread.![]()
@chrisbra commented on this pull request.
> @@ -1114,4 +1114,17 @@ func Test_bitwise_shift()
call assert_equal(64, MultBy2_A()(32))
endfunc
+func Test_unlet_nonexisting_key()
+ let g:base = {}
+ call assert_fails(':unlet g:base["foobar"]', 'E716:')
+
+ try
+ unlet! g:base["foobar"]
+ catch
+ call assert_false(1, "no error when unletting non-existing dict key")
done
—
Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you are subscribed to this thread.![]()
@zeertzjq commented on this pull request.
> +func Test_unlet_nonexisting_key()
+ let g:base = {}
+ call assert_fails(':unlet g:base["foobar"]', 'E716:')
+
+ try
+ unlet! g:base["foobar"]
+ catch
+ call assert_report("error when unletting non-existing dict key")
+ endtry
+ unlet g:base
+
+endfunc
Will it be better to put this test in test_unlet.vim or test_listdict.vim?
—
Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you are subscribed to this thread.![]()