diff src/testdir/test_functions.vim @ 19554:b38d73f36467 v8.2.0334

patch 8.2.0334: abort called when using test_void() Commit: https://github.com/vim/vim/commit/dd58923c6bcb026de7134d9874e69e0a2b01682d Author: Bram Moolenaar <Bram@vim.org> Date: Sat Feb 29 17:38:12 2020 +0100 patch 8.2.0334: abort called when using test_void() Problem: Abort called when using test_void(). (Dominique Pelle) Solution: Only give an error, don't abort.
author Bram Moolenaar <Bram@vim.org>
date Sat, 29 Feb 2020 17:45:04 +0100
parents 9a9ca0e622c8
children da98d2ed8dc5
line wrap: on
line diff
--- a/src/testdir/test_functions.vim
+++ b/src/testdir/test_functions.vim
@@ -63,6 +63,16 @@ func Test_empty()
   call assert_fails("call empty(test_unknown())", 'E685:')
 endfunc
 
+func Test_test_void()
+  call assert_fails('echo 1 == test_void()', 'E685:')
+  if has('float')
+    call assert_fails('echo 1.0 == test_void()', 'E685:')
+  endif
+  call assert_fails('let x = json_encode(test_void())', 'E685:')
+  call assert_fails('let x = copy(test_void())', 'E685:')
+  call assert_fails('let x = copy([test_void()])', 'E685:')
+endfunc
+
 func Test_len()
   call assert_equal(1, len(0))
   call assert_equal(2, len(12))