summaryrefslogtreecommitdiffstats
path: root/src/testdir/test_cdo.vim
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2020-05-28 21:30:11 +0200
committerBram Moolenaar <Bram@vim.org>2020-05-28 21:30:11 +0200
commit14798ab9a5ee4b94f6c12f1986207569356acfc8 (patch)
treec66f6e21112c8e38163c9f2b6442ce5c826dfd29 /src/testdir/test_cdo.vim
parentc998370562425e70f4cf202a87112d638f5f7b38 (diff)
patch 8.2.0836: not all :cdo output is visiblev8.2.0836
Problem: Not all :cdo output is visible. Solution: Reset 'shortmess' temporarily. (Yegappan Lakshmanan, closes #6155)
Diffstat (limited to 'src/testdir/test_cdo.vim')
-rw-r--r--src/testdir/test_cdo.vim38
1 files changed, 25 insertions, 13 deletions
diff --git a/src/testdir/test_cdo.vim b/src/testdir/test_cdo.vim
index 51800a5e6b..dbed7df4ac 100644
--- a/src/testdir/test_cdo.vim
+++ b/src/testdir/test_cdo.vim
@@ -8,22 +8,22 @@ func SetUp()
call writefile(["Line1", "Line2", "Line3"], 'Xtestfile1')
call writefile(["Line1", "Line2", "Line3"], 'Xtestfile2')
call writefile(["Line1", "Line2", "Line3"], 'Xtestfile3')
-endfunction
+endfunc
" Remove the files used by the tests
-function TearDown()
+func TearDown()
call delete('Xtestfile1')
call delete('Xtestfile2')
call delete('Xtestfile3')
-endfunction
+endfunc
" Returns the current line in '<filename> <linenum>L <column>C' format
-function GetRuler()
+func GetRuler()
return expand('%') . ' ' . line('.') . 'L' . ' ' . col('.') . 'C'
-endfunction
+endfunc
" Tests for the :cdo and :ldo commands
-function XdoTests(cchar)
+func XdoTests(cchar)
enew
" Shortcuts for calling the cdo and ldo commands
@@ -132,10 +132,10 @@ function XdoTests(cchar)
exe XdoCmd
call assert_equal(['Xtestfile3 3L 1C'], l)
-endfunction
+endfunc
" Tests for the :cfdo and :lfdo commands
-function XfdoTests(cchar)
+func XfdoTests(cchar)
enew
" Shortcuts for calling the cfdo and lfdo commands
@@ -189,16 +189,28 @@ function XfdoTests(cchar)
exe XfdoCmd
call assert_equal(['Xtestfile2 2L 5C'], l)
-endfunction
+endfunc
" Tests for cdo and cfdo
-function Test_cdo()
+func Test_cdo()
call XdoTests('c')
call XfdoTests('c')
-endfunction
+endfunc
" Tests for ldo and lfdo
-function Test_ldo()
+func Test_ldo()
call XdoTests('l')
call XfdoTests('l')
-endfunction
+endfunc
+
+" Test for making 'shm' doesn't interfere with the output.
+func Test_cdo_print()
+ enew | only!
+ cgetexpr ["Xtestfile1:1:Line1", "Xtestfile2:1:Line1", "Xtestfile3:1:Line1"]
+ cdo print
+ call assert_equal('Line1', Screenline(&lines))
+ call assert_equal('Line1', Screenline(&lines - 3))
+ call assert_equal('Line1', Screenline(&lines - 6))
+endfunc
+
+" vim: shiftwidth=2 sts=2 expandtab