Mercurial > vim
comparison src/testdir/test_cmdline.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 | 2f4be7ca1b1b |
children | 738a4fe2c8c5 |
comparison
equal
deleted
inserted
replaced
19470:ddc2e7caff46 | 19471:cb73f4ae6b7c |
---|---|
975 argadd `=['a', 'b', 'c']` | 975 argadd `=['a', 'b', 'c']` |
976 call assert_equal(['a', 'b', 'c'], argv()) | 976 call assert_equal(['a', 'b', 'c'], argv()) |
977 %argd | 977 %argd |
978 endfunc | 978 endfunc |
979 | 979 |
980 " Test for the :! command | |
981 func Test_cmd_bang() | |
982 if !has('unix') | |
983 return | |
984 endif | |
985 | |
986 let lines =<< trim [SCRIPT] | |
987 " Test for no previous command | |
988 call assert_fails('!!', 'E34:') | |
989 set nomore | |
990 " Test for cmdline expansion with :! | |
991 call setline(1, 'foo!') | |
992 silent !echo <cWORD> > Xfile.out | |
993 call assert_equal(['foo!'], readfile('Xfile.out')) | |
994 " Test for using previous command | |
995 silent !echo \! ! | |
996 call assert_equal(['! echo foo!'], readfile('Xfile.out')) | |
997 call writefile(v:errors, 'Xresult') | |
998 call delete('Xfile.out') | |
999 qall! | |
1000 [SCRIPT] | |
1001 call writefile(lines, 'Xscript') | |
1002 if RunVim([], [], '--clean -S Xscript') | |
1003 call assert_equal([], readfile('Xresult')) | |
1004 endif | |
1005 call delete('Xscript') | |
1006 call delete('Xresult') | |
1007 endfunc | |
1008 | |
980 " vim: shiftwidth=2 sts=2 expandtab | 1009 " vim: shiftwidth=2 sts=2 expandtab |