diff src/testdir/test_vim9_cmd.vim @ 26658:ed73553992bf v8.2.3858

patch 8.2.3858: Vim9: not enough tests Commit: https://github.com/vim/vim/commit/003312b1d2ee2f4922f473b8bf50af6663c0efac Author: Bram Moolenaar <Bram@vim.org> Date: Mon Dec 20 10:55:35 2021 +0000 patch 8.2.3858: Vim9: not enough tests Problem: Vim9: not enough tests. Solution: Add tests for :try/:catch and :redir. Add missing type check.
author Bram Moolenaar <Bram@vim.org>
date Mon, 20 Dec 2021 12:00:04 +0100
parents a07323eb647f
children 2b17f87b7bd1
line wrap: on
line diff
--- a/src/testdir/test_vim9_cmd.vim
+++ b/src/testdir/test_vim9_cmd.vim
@@ -1558,6 +1558,23 @@ def Test_redir_to_var()
     redir END
   END
   CheckDefFailure(lines, 'E1141:')
+
+  lines =<< trim END
+      var text: string
+      redir => text
+        echo 'hello'
+        redir > Xfile
+      redir END
+  END
+  CheckDefFailure(lines, 'E1185:')
+
+  lines =<< trim END
+      var text: number
+      redir => text
+        echo 'hello'
+      redir END
+  END
+  CheckDefFailure(lines, 'E1012:')
 enddef
 
 def Test_echo_void()