Mercurial > vim
comparison src/testdir/test_expand.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 | 67fbe280a502 |
children | 031184ace7c5 |
comparison
equal
deleted
inserted
replaced
19470:ddc2e7caff46 | 19471:cb73f4ae6b7c |
---|---|
79 | 79 |
80 call assert_fails('call expandcmd("make <afile>")', 'E495:') | 80 call assert_fails('call expandcmd("make <afile>")', 'E495:') |
81 call assert_fails('call expandcmd("make <afile>")', 'E495:') | 81 call assert_fails('call expandcmd("make <afile>")', 'E495:') |
82 enew | 82 enew |
83 call assert_fails('call expandcmd("make %")', 'E499:') | 83 call assert_fails('call expandcmd("make %")', 'E499:') |
84 close | 84 let $FOO="blue\tsky" |
85 call setline(1, "$FOO") | |
86 call assert_equal("grep pat blue\tsky", expandcmd('grep pat <cfile>')) | |
87 unlet $FOO | |
88 close! | |
85 endfunc | 89 endfunc |
86 | 90 |
87 " Test for expanding <sfile>, <slnum> and <sflnum> outside of sourcing a script | 91 " Test for expanding <sfile>, <slnum> and <sflnum> outside of sourcing a script |
88 func Test_source_sfile() | 92 func Test_source_sfile() |
89 let lines =<< trim [SCRIPT] | 93 let lines =<< trim [SCRIPT] |
106 endif | 110 endif |
107 call delete('Xscript') | 111 call delete('Xscript') |
108 call delete('Xresult') | 112 call delete('Xresult') |
109 endfunc | 113 endfunc |
110 | 114 |
115 " Test for expanding filenames multiple times in a command line | |
116 func Test_expand_filename_multicmd() | |
117 edit foo | |
118 call setline(1, 'foo!') | |
119 new | |
120 call setline(1, 'foo!') | |
121 new <cword> | new <cWORD> | |
122 call assert_equal(4, winnr('$')) | |
123 call assert_equal('foo!', bufname(winbufnr(1))) | |
124 call assert_equal('foo', bufname(winbufnr(2))) | |
125 %bwipe! | |
126 endfunc | |
111 | 127 |
112 " vim: shiftwidth=2 sts=2 expandtab | 128 " vim: shiftwidth=2 sts=2 expandtab |