From e00b02429520ad2c8f087024900c8adce5b42d46 Mon Sep 17 00:00:00 2001 From: James McCoy Date: Wed, 28 Dec 2016 14:54:30 -0500 Subject: vim-patch:7.4.2149 Problem: If a test leaves a window open a following test may fail. Solution: Always close extra windows after running a test. https://github.com/vim/vim/commit/7cba71d7e3576639679b6a3aedeeb1ac07f7f2f5 Apply the runtest.vim changes that were missing from 4431975210b58c6b0403ee50172bad3c8729bbb2 --- src/nvim/testdir/runtest.vim | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'src/nvim/testdir') diff --git a/src/nvim/testdir/runtest.vim b/src/nvim/testdir/runtest.vim index 931013877d..20863bbaf3 100644 --- a/src/nvim/testdir/runtest.vim +++ b/src/nvim/testdir/runtest.vim @@ -86,6 +86,12 @@ function RunTheTest(test) if exists("*TearDown") call TearDown() endif + + " Close any extra windows and make the current one not modified. + while winnr('$') > 1 + bwipe! + endwhile + set nomodified endfunc " Source the test script. First grab the file name, in case the script -- cgit From 92c7c42f7c2aab4b5f00b5d3785c06a3e2834c28 Mon Sep 17 00:00:00 2001 From: James McCoy Date: Tue, 15 Nov 2016 16:28:23 -0500 Subject: vim-patch:7.4.2183 Problem: Sign tests are old style. Solution: Turn them into new style tests. (Dominique Pelle) https://github.com/vim/vim/commit/09de17536dd84e43aed7a575183e320e8d980b68 --- src/nvim/testdir/Makefile | 1 + src/nvim/testdir/test_signs.vim | 106 ++++++++++++++++++++++++++++++++++++++++ 2 files changed, 107 insertions(+) create mode 100644 src/nvim/testdir/test_signs.vim (limited to 'src/nvim/testdir') diff --git a/src/nvim/testdir/Makefile b/src/nvim/testdir/Makefile index 7cd1921ce1..e27be54fc9 100644 --- a/src/nvim/testdir/Makefile +++ b/src/nvim/testdir/Makefile @@ -40,6 +40,7 @@ NEW_TESTS = \ test_match.res \ test_matchadd_conceal.res \ test_quickfix.res \ + test_signs.res \ test_syntax.res \ test_usercommands.res \ test_timers.res \ diff --git a/src/nvim/testdir/test_signs.vim b/src/nvim/testdir/test_signs.vim new file mode 100644 index 0000000000..f280a3161e --- /dev/null +++ b/src/nvim/testdir/test_signs.vim @@ -0,0 +1,106 @@ +" Test for signs + +if !has('signs') + finish +endif + +func Test_sign() + new + call setline(1, ['a', 'b', 'c', 'd']) + + sign define Sign1 text=x + sign define Sign2 text=y + + " Test listing signs. + let a=execute('sign list') + call assert_equal("\nsign Sign1 text=x \nsign Sign2 text=y ", a) + + let a=execute('sign list Sign1') + call assert_equal("\nsign Sign1 text=x ", a) + + " Place the sign at line 3,then check that we can jump to it. + exe 'sign place 42 line=3 name=Sign1 buffer=' . bufnr('') + 1 + exe 'sign jump 42 buffer=' . bufnr('') + call assert_equal('c', getline('.')) + + " Can't change sign. + call assert_fails("exe 'sign place 43 name=Sign1 buffer=' . bufnr('')", 'E885:') + + let a=execute('sign place') + call assert_equal("\n--- Signs ---\nSigns for [NULL]:\n line=3 id=42 name=Sign1\n", a) + + " Unplace the sign and try jumping to it again should now fail. + sign unplace 42 + 1 + call assert_fails("exe 'sign jump 42 buffer=' . bufnr('')", 'E157:') + call assert_equal('a', getline('.')) + + " Unplace sign on current line. + exe 'sign place 43 line=4 name=Sign2 buffer=' . bufnr('') + 4 + sign unplace + let a=execute('sign place') + call assert_equal("\n--- Signs ---\n", a) + + " Try again to unplace sign on current line, it should fail this time. + call assert_fails('sign unplace', 'E159:') + + " Unplace all signs. + exe 'sign place 42 line=3 name=Sign1 buffer=' . bufnr('') + sign unplace * + let a=execute('sign place') + call assert_equal("\n--- Signs ---\n", a) + + " After undefining the sign, we should no longer be able to place it. + sign undefine Sign1 + sign undefine Sign2 + call assert_fails("exe 'sign place 42 line=3 name=Sign1 buffer=' . bufnr('')", 'E155:') + +endfunc + +func Test_sign_completion() + sign define Sign1 text=x + sign define Sign2 text=y + + call feedkeys(":sign \\\"\", 'tx') + call assert_equal('"sign define jump list place undefine unplace', @:) + + call feedkeys(":sign define Sign \\\"\", 'tx') + call assert_equal('"sign define Sign icon= linehl= text= texthl=', @:) + + call feedkeys(":sign define Sign linehl=Spell\\\"\", 'tx') + call assert_equal('"sign define Sign linehl=SpellBad SpellCap SpellLocal SpellRare', @:) + + call feedkeys(":sign undefine \\\"\", 'tx') + call assert_equal('"sign undefine Sign1 Sign2', @:) + + call feedkeys(":sign place 1 \\\"\", 'tx') + call assert_equal('"sign place 1 buffer= file= line= name=', @:) + + call feedkeys(":sign place 1 name=\\\"\", 'tx') + call assert_equal('"sign place 1 name=Sign1 Sign2', @:) + + call feedkeys(":sign unplace 1 \\\"\", 'tx') + call assert_equal('"sign unplace 1 buffer= file=', @:) + + call feedkeys(":sign list \\\"\", 'tx') + call assert_equal('"sign list Sign1 Sign2', @:) + + call feedkeys(":sign jump 1 \\\"\", 'tx') + call assert_equal('"sign jump 1 buffer= file=', @:) + + sign undefine Sign1 + sign undefine Sign2 + +endfunc + +func Test_sign_invalid_commands() + call assert_fails('sign', 'E471:') + call assert_fails('sign xxx', 'E160:') + call assert_fails('sign define', 'E156:') + call assert_fails('sign undefine', 'E156:') + call assert_fails('sign list xxx', 'E155:') + call assert_fails('sign place 1 buffer=', 'E158:') + call assert_fails('sign define Sign2 text=', 'E239:') +endfunc -- cgit From d4671048162be61096cfcf6beef917166afa5267 Mon Sep 17 00:00:00 2001 From: James McCoy Date: Tue, 15 Nov 2016 16:30:14 -0500 Subject: vim-patch:7.4.2194 Problem: Sign tests don't cover enough. Solution: Add more test cases. (Dominique Pelle) https://github.com/vim/vim/commit/446a973ce3ce4988607292c0e6345db788f12c7b --- src/nvim/testdir/test_signs.vim | 107 ++++++++++++++++++++++++++++++++++------ 1 file changed, 92 insertions(+), 15 deletions(-) (limited to 'src/nvim/testdir') diff --git a/src/nvim/testdir/test_signs.vim b/src/nvim/testdir/test_signs.vim index f280a3161e..79e60986ee 100644 --- a/src/nvim/testdir/test_signs.vim +++ b/src/nvim/testdir/test_signs.vim @@ -8,36 +8,71 @@ func Test_sign() new call setline(1, ['a', 'b', 'c', 'd']) + " Define some signs. + " We can specify icons even if not all versions of vim support icons as + " icon is ignored when not supported. "(not supported)" is shown after + " the icon name when listing signs. sign define Sign1 text=x - sign define Sign2 text=y + try + sign define Sign2 text=xy texthl=Title linehl=Error icon=../../pixmaps/stock_vim_find_help.png + catch /E255:/ + " ignore error: E255: Couldn't read in sign data! + " This error can happen when running in gui. + " Some gui like Motif do not support the png icon format. + endtry " Test listing signs. let a=execute('sign list') - call assert_equal("\nsign Sign1 text=x \nsign Sign2 text=y ", a) + call assert_match("^\nsign Sign1 text=x \nsign Sign2 icon=../../pixmaps/stock_vim_find_help.png .*text=xy linehl=Error texthl=Title$", a) let a=execute('sign list Sign1') call assert_equal("\nsign Sign1 text=x ", a) - " Place the sign at line 3,then check that we can jump to it. - exe 'sign place 42 line=3 name=Sign1 buffer=' . bufnr('') + " Split the window to the bottom to verify sign jump will stay in the current window + " if the buffer is displayed there. + let bn = bufnr('%') + let wn = winnr() + exe 'sign place 41 line=3 name=Sign1 buffer=' . bn + 1 + bot split + exe 'sign jump 41 buffer=' . bufnr('%') + call assert_equal('c', getline('.')) + call assert_equal(3, winnr()) + call assert_equal(bn, bufnr('%')) + call assert_notequal(wn, winnr()) + + " Create a new buffer and check that ":sign jump" switches to the old buffer. 1 - exe 'sign jump 42 buffer=' . bufnr('') + new foo + call assert_notequal(bn, bufnr('%')) + exe 'sign jump 41 buffer=' . bn + call assert_equal(bn, bufnr('%')) call assert_equal('c', getline('.')) - " Can't change sign. - call assert_fails("exe 'sign place 43 name=Sign1 buffer=' . bufnr('')", 'E885:') + " Redraw to make sure that screen redraw with sign gets exercised, + " with and without 'rightleft'. + if has('rightleft') + set rightleft + redraw + set norightleft + endif + redraw + " Check that we can't change sign. + call assert_fails("exe 'sign place 40 name=Sign1 buffer=' . bufnr('%')", 'E885:') + + " Check placed signs let a=execute('sign place') - call assert_equal("\n--- Signs ---\nSigns for [NULL]:\n line=3 id=42 name=Sign1\n", a) + call assert_equal("\n--- Signs ---\nSigns for [NULL]:\n line=3 id=41 name=Sign1\n", a) - " Unplace the sign and try jumping to it again should now fail. - sign unplace 42 + " Unplace the sign and try jumping to it again should fail. + sign unplace 41 1 - call assert_fails("exe 'sign jump 42 buffer=' . bufnr('')", 'E157:') + call assert_fails("exe 'sign jump 41 buffer=' . bufnr('%')", 'E157:') call assert_equal('a', getline('.')) " Unplace sign on current line. - exe 'sign place 43 line=4 name=Sign2 buffer=' . bufnr('') + exe 'sign place 42 line=4 name=Sign2 buffer=' . bufnr('%') 4 sign unplace let a=execute('sign place') @@ -47,16 +82,54 @@ func Test_sign() call assert_fails('sign unplace', 'E159:') " Unplace all signs. - exe 'sign place 42 line=3 name=Sign1 buffer=' . bufnr('') + exe 'sign place 41 line=3 name=Sign1 buffer=' . bufnr('%') sign unplace * let a=execute('sign place') call assert_equal("\n--- Signs ---\n", a) + " Check :jump with file=... + edit foo + call setline(1, ['A', 'B', 'C', 'D']) + + try + sign define Sign3 text=y texthl=DoesNotExist linehl=DoesNotExist icon=doesnotexist.xpm + catch /E255:/ + " ignore error: E255: it can happens for guis. + endtry + + let fn = expand('%:p') + exe 'sign place 43 line=2 name=Sign3 file=' . fn + edit bar + call assert_notequal(fn, expand('%:p')) + exe 'sign jump 43 file=' . fn + call assert_equal('B', getline('.')) + " After undefining the sign, we should no longer be able to place it. sign undefine Sign1 sign undefine Sign2 - call assert_fails("exe 'sign place 42 line=3 name=Sign1 buffer=' . bufnr('')", 'E155:') + sign undefine Sign3 + call assert_fails("exe 'sign place 41 line=3 name=Sign1 buffer=' . bufnr('%')", 'E155:') +endfunc + +" Undefining placed sign is not recommended. +" Quoting :help sign +" +" :sign undefine {name} +" Deletes a previously defined sign. If signs with this {name} +" are still placed this will cause trouble. +func Test_sign_undefine_still_placed() + new foobar + sign define Sign text=x + exe 'sign place 41 line=1 name=Sign buffer=' . bufnr('%') + sign undefine Sign + + " Listing placed sign should show that sign is deleted. + let a=execute('sign place') + call assert_equal("\n--- Signs ---\nSigns for foobar:\n line=1 id=41 name=[Deleted]\n", a) + sign unplace 41 + let a=execute('sign place') + call assert_equal("\n--- Signs ---\n", a) endfunc func Test_sign_completion() @@ -72,6 +145,9 @@ func Test_sign_completion() call feedkeys(":sign define Sign linehl=Spell\\\"\", 'tx') call assert_equal('"sign define Sign linehl=SpellBad SpellCap SpellLocal SpellRare', @:) + call feedkeys(":sign define Sign icon=../../pixmaps/tb_p\\\"\", 'tx') + call assert_equal('"sign define Sign icon=../../pixmaps/tb_paste.xpm ../../pixmaps/tb_print.xpm', @:) + call feedkeys(":sign undefine \\\"\", 'tx') call assert_equal('"sign undefine Sign1 Sign2', @:) @@ -92,13 +168,14 @@ func Test_sign_completion() sign undefine Sign1 sign undefine Sign2 - endfunc func Test_sign_invalid_commands() call assert_fails('sign', 'E471:') + call assert_fails('sign jump', 'E471:') call assert_fails('sign xxx', 'E160:') call assert_fails('sign define', 'E156:') + call assert_fails('sign define Sign1 xxx', 'E475:') call assert_fails('sign undefine', 'E156:') call assert_fails('sign list xxx', 'E155:') call assert_fails('sign place 1 buffer=', 'E158:') -- cgit From 00466410701802214aba5c95f1cbb2e5086a37f5 Mon Sep 17 00:00:00 2001 From: James McCoy Date: Tue, 15 Nov 2016 12:06:10 -0500 Subject: vim-patch:7.4.2204 Problem: It is not easy to get information about buffers, windows and tabpages. Solution: Add getbufinfo(), getwininfo() and gettabinfo(). (Yegappan Lakshmanan) https://github.com/vim/vim/commit/b5ae48e9ffd3b8eb6ca4057de11f1bddcde8ce6f --- src/nvim/testdir/Makefile | 1 + src/nvim/testdir/test_bufwintabinfo.vim | 38 +++++++++++++++++++++++++++++++++ 2 files changed, 39 insertions(+) create mode 100644 src/nvim/testdir/test_bufwintabinfo.vim (limited to 'src/nvim/testdir') diff --git a/src/nvim/testdir/Makefile b/src/nvim/testdir/Makefile index e27be54fc9..84a0c0b889 100644 --- a/src/nvim/testdir/Makefile +++ b/src/nvim/testdir/Makefile @@ -30,6 +30,7 @@ SCRIPTS := \ # Tests using runtest.vim.vim. # Keep test_alot*.res as the last one, sort the others. NEW_TESTS = \ + test_bufwintabinfo.res \ test_cmdline.res \ test_cscope.res \ test_diffmode.res \ diff --git a/src/nvim/testdir/test_bufwintabinfo.vim b/src/nvim/testdir/test_bufwintabinfo.vim new file mode 100644 index 0000000000..236ca30f99 --- /dev/null +++ b/src/nvim/testdir/test_bufwintabinfo.vim @@ -0,0 +1,38 @@ +" Tests for the getbufinfo(), getwininfo() and gettabinfo() functions + +function Test_getbufwintabinfo() + 1,$bwipeout + edit Xtestfile1 + edit Xtestfile2 + let buflist = getbufinfo() + call assert_equal(2, len(buflist)) + call assert_match('Xtestfile1', buflist[0].name) + call assert_match('Xtestfile2', getbufinfo('Xtestfile2')[0].name) + call assert_equal([], getbufinfo(2016)) + edit Xtestfile1 + hide edit Xtestfile2 + hide enew + call assert_equal(3, len(getbufinfo({'bufloaded':1}))) + + only + let w1_id = win_getid() + new + let w2_id = win_getid() + tabnew | let w3_id = win_getid() + new | let w4_id = win_getid() + new | let w5_id = win_getid() + tabfirst + let winlist = getwininfo() + call assert_equal(5, len(winlist)) + call assert_equal(2, winlist[3].tpnr) + let winfo = getwininfo(w5_id)[0] + call assert_equal(2, winfo.tpnr) + call assert_equal([], getwininfo(3)) + + let tablist = gettabinfo() + call assert_equal(2, len(tablist)) + call assert_equal(3, len(tablist[1].windows)) + call assert_equal([], gettabinfo(3)) + + tabonly | only +endfunction -- cgit From 4453aa0d29d7a4e488a4c1799c9d33bcbde432eb Mon Sep 17 00:00:00 2001 From: James McCoy Date: Tue, 15 Nov 2016 13:41:01 -0500 Subject: vim-patch:7.4.2215 Problem: It's not easy to find out if a window is a quickfix or location list window. Solution: Add "loclist" and "quickfix" entries to the dict returnec by getwininfo(). (Yegappan Lakshmanan) https://github.com/vim/vim/commit/386600f0cbcb8add099c723cf84634f46df2f788 --- src/nvim/testdir/test_bufwintabinfo.vim | 45 +++++++++++++++++++++++++++++++++ 1 file changed, 45 insertions(+) (limited to 'src/nvim/testdir') diff --git a/src/nvim/testdir/test_bufwintabinfo.vim b/src/nvim/testdir/test_bufwintabinfo.vim index 236ca30f99..fa9d97bc85 100644 --- a/src/nvim/testdir/test_bufwintabinfo.vim +++ b/src/nvim/testdir/test_bufwintabinfo.vim @@ -14,6 +14,27 @@ function Test_getbufwintabinfo() hide enew call assert_equal(3, len(getbufinfo({'bufloaded':1}))) + set tabstop&vim + let b:editor = 'vim' + let l = getbufinfo('%') + call assert_equal(bufnr('%'), l[0].nr) + call assert_equal(8, l[0].options.tabstop) + call assert_equal('vim', l[0].variables.editor) + call assert_notequal(-1, index(l[0].windows, bufwinid('%'))) + + if has('signs') + call append(0, ['Linux', 'Windows', 'Mac']) + sign define Mark text=>> texthl=Search + exe "sign place 2 line=3 name=Mark buffer=" . bufnr('%') + let l = getbufinfo('%') + call assert_equal(2, l[0].signs[0].id) + call assert_equal(3, l[0].signs[0].lnum) + call assert_equal('Mark', l[0].signs[0].name) + sign unplace * + sign undefine Mark + enew! + endif + only let w1_id = win_getid() new @@ -21,18 +42,42 @@ function Test_getbufwintabinfo() tabnew | let w3_id = win_getid() new | let w4_id = win_getid() new | let w5_id = win_getid() + call setwinvar(0, 'signal', 'green') tabfirst let winlist = getwininfo() call assert_equal(5, len(winlist)) + call assert_equal(winbufnr(2), winlist[1].bufnum) + call assert_equal(winheight(2), winlist[1].height) + call assert_equal(1, winlist[2].nr) + call assert_equal('auto', winlist[0].options.signcolumn) call assert_equal(2, winlist[3].tpnr) + 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.tpnr) call assert_equal([], getwininfo(3)) + call settabvar(1, 'space', 'build') let tablist = gettabinfo() call assert_equal(2, len(tablist)) call assert_equal(3, len(tablist[1].windows)) + call assert_equal(2, tablist[1].nr) + call assert_equal('build', tablist[0].variables.space) + call assert_equal(w2_id, tablist[0].windows[0]) call assert_equal([], gettabinfo(3)) tabonly | only + + lexpr '' + lopen + copen + let winlist = getwininfo() + call assert_false(winlist[0].quickfix) + call assert_false(winlist[0].loclist) + call assert_true(winlist[1].quickfix) + call assert_true(winlist[1].loclist) + call assert_true(winlist[2].quickfix) + call assert_false(winlist[2].loclist) + wincmd t | only endfunction -- cgit From 486e968bb6bdfb49d17305d6f7747408eda95926 Mon Sep 17 00:00:00 2001 From: James McCoy Date: Tue, 15 Nov 2016 16:38:33 -0500 Subject: vim-patch:7.4.2225 Problem: Crash when placing a sign in a deleted buffer. Solution: Check for missing buffer name. (Dominique Pelle). Add a test. https://github.com/vim/vim/commit/bfd096d02087a10e8e2f4bdfb74e0435506fa8bb --- src/nvim/testdir/test_signs.vim | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'src/nvim/testdir') diff --git a/src/nvim/testdir/test_signs.vim b/src/nvim/testdir/test_signs.vim index 79e60986ee..93cc62cd9c 100644 --- a/src/nvim/testdir/test_signs.vim +++ b/src/nvim/testdir/test_signs.vim @@ -181,3 +181,15 @@ func Test_sign_invalid_commands() call assert_fails('sign place 1 buffer=', 'E158:') call assert_fails('sign define Sign2 text=', 'E239:') endfunc + +func Test_sign_delete_buffer() + new + sign define Sign text=x + let bufnr = bufnr('%') + new + exe 'bd ' . bufnr + exe 'sign place 61 line=3 name=Sign buffer=' . bufnr + call assert_fails('sign jump 61 buffer=' . bufnr, 'E934:') + sign unplace 61 + sign undefine Sign +endfunc -- cgit From c4c894b2fada371c424e55d26174110b9069b5f8 Mon Sep 17 00:00:00 2001 From: James McCoy Date: Tue, 15 Nov 2016 16:46:11 -0500 Subject: vim-patch:7.4.2226 Problem: The field names used by getbufinfo(), gettabinfo() and getwininfo() are not consistent. Solution: Use bufnr, winnr and tabnr. (Yegappan Lakshmanan) https://github.com/vim/vim/commit/339288377072f66ec88e21903e75a82d23ffbf4f --- src/nvim/testdir/test_bufwintabinfo.vim | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'src/nvim/testdir') diff --git a/src/nvim/testdir/test_bufwintabinfo.vim b/src/nvim/testdir/test_bufwintabinfo.vim index fa9d97bc85..42c016621f 100644 --- a/src/nvim/testdir/test_bufwintabinfo.vim +++ b/src/nvim/testdir/test_bufwintabinfo.vim @@ -17,7 +17,7 @@ function Test_getbufwintabinfo() set tabstop&vim let b:editor = 'vim' let l = getbufinfo('%') - call assert_equal(bufnr('%'), l[0].nr) + call assert_equal(bufnr('%'), l[0].bufnr) call assert_equal(8, l[0].options.tabstop) call assert_equal('vim', l[0].variables.editor) call assert_notequal(-1, index(l[0].windows, bufwinid('%'))) @@ -46,23 +46,23 @@ function Test_getbufwintabinfo() tabfirst let winlist = getwininfo() call assert_equal(5, len(winlist)) - call assert_equal(winbufnr(2), winlist[1].bufnum) + call assert_equal(winbufnr(2), winlist[1].bufnr) call assert_equal(winheight(2), winlist[1].height) - call assert_equal(1, winlist[2].nr) + call assert_equal(1, winlist[2].winnr) call assert_equal('auto', winlist[0].options.signcolumn) - call assert_equal(2, winlist[3].tpnr) + call assert_equal(2, winlist[3].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.tpnr) + call assert_equal(2, winfo.tabnr) call assert_equal([], getwininfo(3)) call settabvar(1, 'space', 'build') let tablist = gettabinfo() call assert_equal(2, len(tablist)) call assert_equal(3, len(tablist[1].windows)) - call assert_equal(2, tablist[1].nr) + call assert_equal(2, tablist[1].tabnr) call assert_equal('build', tablist[0].variables.space) call assert_equal(w2_id, tablist[0].windows[0]) call assert_equal([], gettabinfo(3)) -- cgit From fe03ce23bfc5c45545b53d4959aeeb27d82753ed Mon Sep 17 00:00:00 2001 From: James McCoy Date: Mon, 12 Dec 2016 23:01:53 -0500 Subject: vim-patch:7.4.2273 Problem: getwininfo() and getbufinfo() are inefficient. Solution: Do not make a copy of all window/buffer-local options. Make it possible to get them with gettabwinvar() or getbufvar(). https://github.com/vim/vim/commit/3056735ae8a366aa7fcb51872520895251858637 --- src/nvim/testdir/test_bufwintabinfo.vim | 24 ++++++++++++++++++++++-- 1 file changed, 22 insertions(+), 2 deletions(-) (limited to 'src/nvim/testdir') diff --git a/src/nvim/testdir/test_bufwintabinfo.vim b/src/nvim/testdir/test_bufwintabinfo.vim index 42c016621f..5c916e2dd7 100644 --- a/src/nvim/testdir/test_bufwintabinfo.vim +++ b/src/nvim/testdir/test_bufwintabinfo.vim @@ -18,7 +18,6 @@ function Test_getbufwintabinfo() let b:editor = 'vim' let l = getbufinfo('%') call assert_equal(bufnr('%'), l[0].bufnr) - call assert_equal(8, l[0].options.tabstop) call assert_equal('vim', l[0].variables.editor) call assert_notequal(-1, index(l[0].windows, bufwinid('%'))) @@ -49,7 +48,6 @@ function Test_getbufwintabinfo() call assert_equal(winbufnr(2), winlist[1].bufnr) call assert_equal(winheight(2), winlist[1].height) call assert_equal(1, winlist[2].winnr) - call assert_equal('auto', winlist[0].options.signcolumn) call assert_equal(2, winlist[3].tabnr) call assert_equal('green', winlist[2].variables.signal) call assert_equal(winwidth(1), winlist[0].width) @@ -81,3 +79,25 @@ function Test_getbufwintabinfo() call assert_false(winlist[2].loclist) wincmd t | only endfunction + +function Test_get_buf_options() + let opts = getbufvar(bufnr('%'), '&') + call assert_equal(v:t_dict, type(opts)) + call assert_equal(8, opts.tabstop) +endfunc + +function Test_get_win_options() + let opts = getwinvar(1, '&') + call assert_equal(v:t_dict, type(opts)) + call assert_equal(0, opts.linebreak) + if has('signs') + call assert_equal('auto', opts.signcolumn) + endif + + let opts = gettabwinvar(1, 1, '&') + call assert_equal(v:t_dict, type(opts)) + call assert_equal(0, opts.linebreak) + if has('signs') + call assert_equal('auto', opts.signcolumn) + endif +endfunc -- cgit From 552cc4d0b3c9ebfd7ca30bfac71fab4ee5d9188e Mon Sep 17 00:00:00 2001 From: James McCoy Date: Mon, 12 Dec 2016 23:26:51 -0500 Subject: vim-patch:7.4.2294 Problem: Sign test fails on MS-Windows when using the distributed zip archives. Solution: Create dummy files instead of relying on files in the pixmaps directory. https://github.com/vim/vim/commit/64cefedfc834aa4dac54ae5f91ccbc04e2d56bc5 --- src/nvim/testdir/test_signs.vim | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'src/nvim/testdir') diff --git a/src/nvim/testdir/test_signs.vim b/src/nvim/testdir/test_signs.vim index 93cc62cd9c..75dbd74b34 100644 --- a/src/nvim/testdir/test_signs.vim +++ b/src/nvim/testdir/test_signs.vim @@ -145,8 +145,12 @@ func Test_sign_completion() call feedkeys(":sign define Sign linehl=Spell\\\"\", 'tx') call assert_equal('"sign define Sign linehl=SpellBad SpellCap SpellLocal SpellRare', @:) - call feedkeys(":sign define Sign icon=../../pixmaps/tb_p\\\"\", 'tx') - call assert_equal('"sign define Sign icon=../../pixmaps/tb_paste.xpm ../../pixmaps/tb_print.xpm', @:) + call writefile(['foo'], 'XsignOne') + call writefile(['bar'], 'XsignTwo') + call feedkeys(":sign define Sign icon=Xsig\\\"\", 'tx') + call assert_equal('"sign define Sign icon=XsignOne XsignTwo', @:) + call delete('XsignOne') + call delete('XsignTwo') call feedkeys(":sign undefine \\\"\", 'tx') call assert_equal('"sign undefine Sign1 Sign2', @:) -- cgit