Mercurial > vim
comparison 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 |
comparison
equal
deleted
inserted
replaced
19470:ddc2e7caff46 | 19471:cb73f4ae6b7c |
---|---|
1968 call writefile(['while v:true', 'echo "."'], 'Xscript') | 1968 call writefile(['while v:true', 'echo "."'], 'Xscript') |
1969 call assert_fails('source Xscript', 'E170:') | 1969 call assert_fails('source Xscript', 'E170:') |
1970 call writefile(['try', 'echo "."'], 'Xscript') | 1970 call writefile(['try', 'echo "."'], 'Xscript') |
1971 call assert_fails('source Xscript', 'E600:') | 1971 call assert_fails('source Xscript', 'E600:') |
1972 call delete('Xscript') | 1972 call delete('Xscript') |
1973 | |
1974 " Using endfor with :while | |
1975 let caught_e732 = 0 | |
1976 try | |
1977 while v:true | |
1978 endfor | |
1979 catch /E732:/ | |
1980 let caught_e732 = 1 | |
1981 endtry | |
1982 call assert_equal(1, caught_e732) | |
1983 | |
1984 " Using endwhile with :for | |
1985 let caught_e733 = 0 | |
1986 try | |
1987 for i in range(1) | |
1988 endwhile | |
1989 catch /E733:/ | |
1990 let caught_e733 = 1 | |
1991 endtry | |
1992 call assert_equal(1, caught_e733) | |
1993 | |
1994 " Missing 'in' in a :for statement | |
1995 call assert_fails('for i range(1) | endfor', 'E690:') | |
1973 endfunc | 1996 endfunc |
1974 | 1997 |
1975 " Test for deep nesting of if/for/while/try statements {{{1 | 1998 " Test for deep nesting of if/for/while/try statements {{{1 |
1976 func Test_deep_nest() | 1999 func Test_deep_nest() |
1977 if !CanRunVimInTerminal() | 2000 if !CanRunVimInTerminal() |