diff src/testdir/test_vimscript.vim @ 19471:cb73f4ae6b7c v8.2.0293

patch 8.2.0293: various Ex commands not sufficiently tested Commit: https://github.com/vim/vim/commit/818fc9ad143911b2faa0d7cee86724aa70a02080 Author: Bram Moolenaar <Bram@vim.org> Date: Fri Feb 21 17:54:45 2020 +0100 patch 8.2.0293: various Ex commands not sufficiently tested Problem: Various Ex commands not sufficiently tested. Solution: Add more test cases. (Yegappan Lakshmanan, closes https://github.com/vim/vim/issues/5673)
author Bram Moolenaar <Bram@vim.org>
date Fri, 21 Feb 2020 18:00:05 +0100
parents fdfe44ac6a1a
children 9a9ca0e622c8
line wrap: on
line diff
--- a/src/testdir/test_vimscript.vim
+++ b/src/testdir/test_vimscript.vim
@@ -1970,6 +1970,29 @@ func Test_missing_end()
   call writefile(['try', 'echo "."'], 'Xscript')
   call assert_fails('source Xscript', 'E600:')
   call delete('Xscript')
+
+  " Using endfor with :while
+  let caught_e732 = 0
+  try
+    while v:true
+    endfor
+  catch /E732:/
+    let caught_e732 = 1
+  endtry
+  call assert_equal(1, caught_e732)
+
+  " Using endwhile with :for
+  let caught_e733 = 0
+  try
+    for i in range(1)
+    endwhile
+  catch /E733:/
+    let caught_e733 = 1
+  endtry
+  call assert_equal(1, caught_e733)
+
+  " Missing 'in' in a :for statement
+  call assert_fails('for i range(1) | endfor', 'E690:')
 endfunc
 
 " Test for deep nesting of if/for/while/try statements              {{{1