Mercurial > vim
comparison src/testdir/test_source.vim @ 24287:c2a234e8c896 v8.2.2684
patch 8.2.2684: not enough folding code is tested
Commit: https://github.com/vim/vim/commit/5c504f680e63120fea36becfabb8d939d4449e34
Author: Bram Moolenaar <Bram@vim.org>
Date: Thu Apr 1 13:39:51 2021 +0200
patch 8.2.2684: not enough folding code is tested
Problem: Not enough folding code is tested.
Solution: Add more test cases. (Yegappan Lakshmanan, closes https://github.com/vim/vim/issues/8046)
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Thu, 01 Apr 2021 13:45:02 +0200 |
parents | 9cbe3a4f1492 |
children | fc859aea8cec |
comparison
equal
deleted
inserted
replaced
24286:6b4e26be980f | 24287:c2a234e8c896 |
---|---|
1 " Tests for the :source command. | 1 " Tests for the :source command. |
2 | |
3 source check.vim | |
4 source view_util.vim | |
2 | 5 |
3 func Test_source_autocmd() | 6 func Test_source_autocmd() |
4 call writefile([ | 7 call writefile([ |
5 \ 'let did_source = 1', | 8 \ 'let did_source = 1', |
6 \ ], 'Xsourced') | 9 \ ], 'Xsourced') |
91 call assert_fails('scriptencoding utf-8', 'E167:') | 94 call assert_fails('scriptencoding utf-8', 'E167:') |
92 call assert_fails('finish', 'E168:') | 95 call assert_fails('finish', 'E168:') |
93 call assert_fails('scriptversion 2', 'E984:') | 96 call assert_fails('scriptversion 2', 'E984:') |
94 endfunc | 97 endfunc |
95 | 98 |
99 " Test for sourcing a script recursively | |
100 func Test_nested_script() | |
101 CheckRunVimInTerminal | |
102 call writefile([':source! Xscript.vim', ''], 'Xscript.vim') | |
103 let buf = RunVimInTerminal('', {'rows': 6}) | |
104 call term_wait(buf) | |
105 call term_sendkeys(buf, ":set noruler\n") | |
106 call term_sendkeys(buf, ":source! Xscript.vim\n") | |
107 call term_wait(buf) | |
108 call WaitForAssert({-> assert_match('E22: Scripts nested too deep\s*', term_getline(buf, 6))}) | |
109 call delete('Xscript.vim') | |
110 call StopVimInTerminal(buf) | |
111 endfunc | |
112 | |
96 " vim: shiftwidth=2 sts=2 expandtab | 113 " vim: shiftwidth=2 sts=2 expandtab |