aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/testdir
diff options
context:
space:
mode:
authorJustin M. Keyes <justinkz@gmail.com>2018-08-21 08:20:40 +0200
committerGitHub <noreply@github.com>2018-08-21 08:20:40 +0200
commit150b1b7b40957b1b4d89e0182e685d39e33ef227 (patch)
treef8cba151375793aeadc538dce96df130726a9d3e /src/nvim/testdir
parent0839c442574cc6f272bee53d350c0d155b74894a (diff)
parentc03fc7ef3e74290b9aafa288b6ead9fefa26f09f (diff)
downloadrneovim-150b1b7b40957b1b4d89e0182e685d39e33ef227.tar.gz
rneovim-150b1b7b40957b1b4d89e0182e685d39e33ef227.tar.bz2
rneovim-150b1b7b40957b1b4d89e0182e685d39e33ef227.zip
Merge #8861 from janlazo/vim-8.0.1364
Diffstat (limited to 'src/nvim/testdir')
-rw-r--r--src/nvim/testdir/test_bufwintabinfo.vim22
-rw-r--r--src/nvim/testdir/test_normal.vim5
-rw-r--r--src/nvim/testdir/test_tabpage.vim66
-rw-r--r--src/nvim/testdir/test_window_cmd.vim13
4 files changed, 68 insertions, 38 deletions
diff --git a/src/nvim/testdir/test_bufwintabinfo.vim b/src/nvim/testdir/test_bufwintabinfo.vim
index a592cd7b11..a6b4524cc0 100644
--- a/src/nvim/testdir/test_bufwintabinfo.vim
+++ b/src/nvim/testdir/test_bufwintabinfo.vim
@@ -39,17 +39,35 @@ function Test_getbufwintabinfo()
let w2_id = win_getid()
tabnew | let w3_id = win_getid()
new | let w4_id = win_getid()
- new | let w5_id = win_getid()
+ vert new | let w5_id = win_getid()
call setwinvar(0, 'signal', 'green')
tabfirst
let winlist = getwininfo()
call assert_equal(5, len(winlist))
+ call assert_equal(winwidth(1), winlist[0].width)
+ call assert_equal(0, winlist[0].wincol)
+ let tablineheight = winlist[0].winrow == 1 ? 1 : 0
+ call assert_equal(tablineheight, winlist[0].winrow) " tabline adds one
+
call assert_equal(winbufnr(2), winlist[1].bufnr)
call assert_equal(winheight(2), winlist[1].height)
+ call assert_equal(0, winlist[1].wincol)
+ call assert_equal(tablineheight + winheight(1) + 1, winlist[1].winrow)
+
call assert_equal(1, winlist[2].winnr)
+ call assert_equal(tablineheight, winlist[2].winrow)
+ call assert_equal(0, winlist[2].wincol)
+
+ call assert_equal(winlist[2].width + 1, winlist[3].wincol)
+ call assert_equal(0, winlist[4].wincol)
+
+ call assert_equal(1, winlist[0].tabnr)
+ call assert_equal(1, winlist[1].tabnr)
+ call assert_equal(2, winlist[2].tabnr)
call assert_equal(2, winlist[3].tabnr)
+ call assert_equal(2, winlist[4].tabnr)
+
call assert_equal('green', winlist[2].variables.signal)
- call assert_equal(winwidth(1), winlist[0].width)
call assert_equal(w4_id, winlist[3].winid)
let winfo = getwininfo(w5_id)[0]
call assert_equal(2, winfo.tabnr)
diff --git a/src/nvim/testdir/test_normal.vim b/src/nvim/testdir/test_normal.vim
index caa530e4aa..3ff1e98caf 100644
--- a/src/nvim/testdir/test_normal.vim
+++ b/src/nvim/testdir/test_normal.vim
@@ -2201,10 +2201,11 @@ func! Test_normal44_textobjects2()
endfunc
func! Test_normal45_drop()
- if !has("dnd")
+ if !has('dnd')
return
endif
- " basic test for :drop command
+
+ " basic test for drag-n-drop
" unfortunately, without a gui, we can't really test much here,
" so simply test that ~p fails (which uses the drop register)
new
diff --git a/src/nvim/testdir/test_tabpage.vim b/src/nvim/testdir/test_tabpage.vim
index a2eec2cc11..add9b3d7cf 100644
--- a/src/nvim/testdir/test_tabpage.vim
+++ b/src/nvim/testdir/test_tabpage.vim
@@ -42,40 +42,38 @@ function Test_tabpage()
call assert_true(t:val_num == 100 && t:val_str == 'SetTabVar test' && t:val_list == ['red', 'blue', 'green'])
tabclose
- if has('nvim') || has('gui') || has('clientserver')
- " Test for ":tab drop exist-file" to keep current window.
- sp test1
- tab drop test1
- call assert_true(tabpagenr('$') == 1 && winnr('$') == 2 && winnr() == 1)
- close
- "
- "
- " Test for ":tab drop new-file" to keep current window of tabpage 1.
- split
- tab drop newfile
- call assert_true(tabpagenr('$') == 2 && tabpagewinnr(1, '$') == 2 && tabpagewinnr(1) == 1)
- tabclose
- q
- "
- "
- " Test for ":tab drop multi-opend-file" to keep current tabpage and window.
- new test1
- tabnew
- new test1
- tab drop test1
- call assert_true(tabpagenr() == 2 && tabpagewinnr(2, '$') == 2 && tabpagewinnr(2) == 1)
- tabclose
- q
- "
- "
- " Test for ":tab drop vertical-split-window" to jump test1 buffer
- tabedit test1
- vnew
- tabfirst
- tab drop test1
- call assert_equal([2, 2, 2, 2], [tabpagenr('$'), tabpagenr(), tabpagewinnr(2, '$'), tabpagewinnr(2)])
- 1tabonly
- endif
+ " Test for ":tab drop exist-file" to keep current window.
+ sp test1
+ tab drop test1
+ call assert_true(tabpagenr('$') == 1 && winnr('$') == 2 && winnr() == 1)
+ close
+ "
+ "
+ " Test for ":tab drop new-file" to keep current window of tabpage 1.
+ split
+ tab drop newfile
+ call assert_true(tabpagenr('$') == 2 && tabpagewinnr(1, '$') == 2 && tabpagewinnr(1) == 1)
+ tabclose
+ q
+ "
+ "
+ " Test for ":tab drop multi-opend-file" to keep current tabpage and window.
+ new test1
+ tabnew
+ new test1
+ tab drop test1
+ call assert_true(tabpagenr() == 2 && tabpagewinnr(2, '$') == 2 && tabpagewinnr(2) == 1)
+ tabclose
+ q
+ "
+ "
+ " Test for ":tab drop vertical-split-window" to jump test1 buffer
+ tabedit test1
+ vnew
+ tabfirst
+ tab drop test1
+ call assert_equal([2, 2, 2, 2], [tabpagenr('$'), tabpagenr(), tabpagewinnr(2, '$'), tabpagewinnr(2)])
+ 1tabonly
"
"
for i in range(9) | tabnew | endfor
diff --git a/src/nvim/testdir/test_window_cmd.vim b/src/nvim/testdir/test_window_cmd.vim
index ad60c8d3c7..b3ab6957dc 100644
--- a/src/nvim/testdir/test_window_cmd.vim
+++ b/src/nvim/testdir/test_window_cmd.vim
@@ -374,6 +374,19 @@ func Test_equalalways_on_close()
set equalalways&
endfunc
+func Test_win_screenpos()
+ call assert_equal(1, winnr('$'))
+ split
+ vsplit
+ 10wincmd _
+ 30wincmd |
+ call assert_equal([1, 1], win_screenpos(1))
+ call assert_equal([1, 32], win_screenpos(2))
+ call assert_equal([12, 1], win_screenpos(3))
+ call assert_equal([0, 0], win_screenpos(4))
+ only
+endfunc
+
func Test_window_jump_tag()
help
/iccf