aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/testdir/test_functions.vim
diff options
context:
space:
mode:
authorJan Edmund Lazo <jan.lazo@mail.utoronto.ca>2021-04-15 18:15:45 -0400
committerJan Edmund Lazo <jan.lazo@mail.utoronto.ca>2021-04-15 18:30:04 -0400
commit97288e73c27d45b0fadbd6efa437fe54bc58b5e3 (patch)
tree1c28ab9cb3df836e149a92ca878548b1b4758f1e /src/nvim/testdir/test_functions.vim
parent7d3f31c0643f40645292e03565d18961e8cd72d7 (diff)
downloadrneovim-97288e73c27d45b0fadbd6efa437fe54bc58b5e3.tar.gz
rneovim-97288e73c27d45b0fadbd6efa437fe54bc58b5e3.tar.bz2
rneovim-97288e73c27d45b0fadbd6efa437fe54bc58b5e3.zip
vim-patch:8.2.2764: memory leak when default function argument is allocated
Problem: Memory leak when default function argument is allocated. Solution: Free the expression result. https://github.com/vim/vim/commit/b47bed2f7ada4dfae78f76f27473b83507e40315
Diffstat (limited to 'src/nvim/testdir/test_functions.vim')
-rw-r--r--src/nvim/testdir/test_functions.vim16
1 files changed, 12 insertions, 4 deletions
diff --git a/src/nvim/testdir/test_functions.vim b/src/nvim/testdir/test_functions.vim
index 555f549743..93f567b3a0 100644
--- a/src/nvim/testdir/test_functions.vim
+++ b/src/nvim/testdir/test_functions.vim
@@ -1071,10 +1071,10 @@ func Test_inputlist()
endfunc
func Test_balloon_show()
- if has('balloon_eval')
- " This won't do anything but must not crash either.
- call balloon_show('hi!')
- endif
+ CheckFeature balloon_eval
+
+ " This won't do anything but must not crash either.
+ call balloon_show('hi!')
endfunc
func Test_shellescape()
@@ -1448,4 +1448,12 @@ func Test_nr2char()
call assert_equal("\x80\xfc\b\xfd\x80\xfeX\x80\xfeX\x80\xfeX\x80\xfeX\x80\xfeX", eval('"\<M-' .. nr2char(0x40000000) .. '>"'))
endfunc
+func HasDefault(msg = 'msg')
+ return a:msg
+endfunc
+
+func Test_default_arg_value()
+ call assert_equal('msg', HasDefault())
+endfunc
+
" vim: shiftwidth=2 sts=2 expandtab