summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2019-08-03 22:55:50 +0200
committerBram Moolenaar <Bram@vim.org>2019-08-03 22:55:50 +0200
commit3c8ee629745737aa231fdd123826ae021e398e49 (patch)
treeede1f3b7673776045644a1059d14af30295cfe51
parentac92e25a33c37ec5becbfffeccda136c73b761ac (diff)
patch 8.1.1804: no test for display updating without a scroll regionv8.1.1804
Problem: No test for display updating without a scroll region. Solution: Add a test.
-rw-r--r--src/testdir/check.vim17
-rw-r--r--src/testdir/dumps/Test_scroll_no_region_1.dump10
-rw-r--r--src/testdir/dumps/Test_scroll_no_region_2.dump10
-rw-r--r--src/testdir/dumps/Test_scroll_no_region_3.dump10
-rw-r--r--src/testdir/test_diffmode.vim19
-rw-r--r--src/testdir/test_display.vim41
-rw-r--r--src/version.c2
7 files changed, 89 insertions, 20 deletions
diff --git a/src/testdir/check.vim b/src/testdir/check.vim
index 48dbd85396..5d61f0dbaf 100644
--- a/src/testdir/check.vim
+++ b/src/testdir/check.vim
@@ -37,3 +37,20 @@ func CheckUnix()
throw 'Skipped: only works on Unix'
endif
endfunc
+
+" Command to check that making screendumps is supported.
+" Caller must source screendump.vim
+command CheckScreendump call CheckScreendump()
+func CheckScreendump()
+ if !CanRunVimInTerminal()
+ throw 'Skipped: cannot make screendumps'
+ endif
+endfunc
+
+" Command to check that we can Run Vim in a terminal window
+command CheckRunVimInTerminal call CheckRunVimInTerminal()
+func CheckRunVimInTerminal()
+ if !CanRunVimInTerminal()
+ throw 'Skipped: cannot run Vim in a terminal window'
+ endif
+endfunc
diff --git a/src/testdir/dumps/Test_scroll_no_region_1.dump b/src/testdir/dumps/Test_scroll_no_region_1.dump
new file mode 100644
index 0000000000..c0c21b5e70
--- /dev/null
+++ b/src/testdir/dumps/Test_scroll_no_region_1.dump
@@ -0,0 +1,10 @@
+>1+0&#ffffff0| @73
+|2| @73
+|3| @73
+|4| @73
+|5| @73
+|6| @73
+|7| @73
+|8| @73
+|[+3&&|N|o| |N|a|m|e|]| |[|+|]| @43|1|,|1| @11|T|o|p
+| +0&&@74
diff --git a/src/testdir/dumps/Test_scroll_no_region_2.dump b/src/testdir/dumps/Test_scroll_no_region_2.dump
new file mode 100644
index 0000000000..b8f7c03f75
--- /dev/null
+++ b/src/testdir/dumps/Test_scroll_no_region_2.dump
@@ -0,0 +1,10 @@
+|1+0&#ffffff0| @73
+|2| @73
+>4| @73
+|5| @73
+|6| @73
+|7| @73
+|8| @73
+|9| @73
+|[+3&&|N|o| |N|a|m|e|]| |[|+|]| @43|3|,|1| @11|T|o|p
+| +0&&@74
diff --git a/src/testdir/dumps/Test_scroll_no_region_3.dump b/src/testdir/dumps/Test_scroll_no_region_3.dump
new file mode 100644
index 0000000000..7ec5a3c32a
--- /dev/null
+++ b/src/testdir/dumps/Test_scroll_no_region_3.dump
@@ -0,0 +1,10 @@
+|1+0&#ffffff0| @73
+|2| @73
+|4| @73
+|5| @73
+>3| @73
+|6| @73
+|7| @73
+|8| @73
+|[+3&&|N|o| |N|a|m|e|]| |[|+|]| @43|5|,|1| @11|T|o|p
+| +0&&@74
diff --git a/src/testdir/test_diffmode.vim b/src/testdir/test_diffmode.vim
index f82a11c925..aae8b363b3 100644
--- a/src/testdir/test_diffmode.vim
+++ b/src/testdir/test_diffmode.vim
@@ -1,6 +1,7 @@
" Tests for diff mode
source shared.vim
source screendump.vim
+source check.vim
func Test_diff_fold_sync()
enew!
@@ -748,9 +749,9 @@ func VerifyInternal(buf, dumpfile, extra)
endfunc
func Test_diff_screen()
- if !CanRunVimInTerminal() || !has('menu')
- throw 'Skipped: cannot make screendumps and/or menu feature missing'
- endif
+ CheckScreendump
+ CheckFeature menu
+
" clean up already existing swap files, just in case
call delete('.Xfile1.swp')
call delete('.Xfile2.swp')
@@ -880,9 +881,7 @@ func Test_diff_screen()
endfunc
func Test_diff_with_cursorline()
- if !CanRunVimInTerminal()
- throw 'Skipped: cannot run Vim in a terminal window'
- endif
+ CheckScreendump
call writefile([
\ 'hi CursorLine ctermbg=red ctermfg=white',
@@ -907,12 +906,8 @@ func Test_diff_with_cursorline()
endfunc
func Test_diff_of_diff()
- if !CanRunVimInTerminal()
- throw 'Skipped: cannot run Vim in a terminal window'
- endif
- if !has("rightleft")
- throw 'Skipped: rightleft not supported'
- endif
+ CheckScreendump
+ CheckFeature rightleft
call writefile([
\ 'call setline(1, ["aa","bb","cc","@@ -3,2 +5,7 @@","dd","ee","ff"])',
diff --git a/src/testdir/test_display.vim b/src/testdir/test_display.vim
index 81ffb2c944..dfa641bbdf 100644
--- a/src/testdir/test_display.vim
+++ b/src/testdir/test_display.vim
@@ -4,11 +4,12 @@ if !has('gui_running') && has('unix')
endif
source view_util.vim
+source check.vim
+source screendump.vim
func Test_display_foldcolumn()
- if !has("folding")
- return
- endif
+ CheckFeature folding
+
new
vnew
vert resize 25
@@ -24,10 +25,10 @@ func Test_display_foldcolumn()
call cursor(2, 1)
norm! zt
- let lines=ScreenLines([1,2], winwidth(0))
+ let lines = ScreenLines([1,2], winwidth(0))
call assert_equal(expect, lines)
set fdc=2
- let lines=ScreenLines([1,2], winwidth(0))
+ let lines = ScreenLines([1,2], winwidth(0))
let expect = [
\ " e more noise blah blah<",
\ " 82> more stuff here "
@@ -39,9 +40,8 @@ func Test_display_foldcolumn()
endfunc
func Test_display_foldtext_mbyte()
- if !has("folding")
- return
- endif
+ CheckFeature folding
+
call NewWindow(10, 40)
call append(0, range(1,20))
exe "set foldmethod=manual foldtext=foldtext() fillchars=fold:\u2500,vert:\u2502 fdc=2"
@@ -67,3 +67,28 @@ func Test_display_foldtext_mbyte()
set foldtext& fillchars& foldmethod& fdc&
bw!
endfunc
+
+" check that win_ins_lines() and win_del_lines() work when t_cs is empty.
+func Test_scroll_without_region()
+ CheckScreendump
+
+ let lines =<< trim END
+ call setline(1, range(1, 20))
+ set t_cs=
+ set laststatus=2
+ END
+ call writefile(lines, 'Xtestscroll')
+ let buf = RunVimInTerminal('-S Xtestscroll', #{rows: 10})
+
+ call VerifyScreenDump(buf, 'Test_scroll_no_region_1', {})
+
+ call term_sendkeys(buf, ":3delete\<cr>")
+ call VerifyScreenDump(buf, 'Test_scroll_no_region_2', {})
+
+ call term_sendkeys(buf, ":4put\<cr>")
+ call VerifyScreenDump(buf, 'Test_scroll_no_region_3', {})
+
+ " clean up
+ call StopVimInTerminal(buf)
+ call delete('Xtestscroll')
+endfunc
diff --git a/src/version.c b/src/version.c
index 5e027dd2bb..d249d859af 100644
--- a/src/version.c
+++ b/src/version.c
@@ -774,6 +774,8 @@ static char *(features[]) =
static int included_patches[] =
{ /* Add new patch number below this line */
/**/
+ 1804,
+/**/
1803,
/**/
1802,