diff --git a/src/Makefile b/src/Makefile index b248d10da0..980e632f07 100644 --- a/src/Makefile +++ b/src/Makefile @@ -2049,7 +2049,6 @@ test1 \ test_marks \ test_nested_function \ test_search_mbyte \ - test_signs \ test_tagcase \ test_utf8 \ test_wordcount \ @@ -2127,10 +2126,11 @@ test_arglist \ test_regexp_utf8 \ test_reltime \ test_ruby \ - test_startup \ test_searchpos \ test_set \ + test_signs \ test_sort \ + test_startup \ test_stat \ test_statusline \ test_syn_attr \ diff --git a/src/term.c b/src/term.c index 036d82bcf9..90505180a2 100644 --- a/src/term.c +++ b/src/term.c @@ -6110,6 +6110,7 @@ gui_get_color_cmn(char_u *name) {(char_u *)"gray", RGB(0xBE, 0xBE, 0xBE)}, {(char_u *)"green", RGB(0x00, 0xFF, 0x00)}, {(char_u *)"grey", RGB(0xBE, 0xBE, 0xBE)}, + {(char_u *)"grey40", RGB(0x66, 0x66, 0x66)}, {(char_u *)"grey90", RGB(0xE5, 0xE5, 0xE5)}, {(char_u *)"lightblue", RGB(0xAD, 0xD8, 0xE6)}, {(char_u *)"lightcyan", RGB(0xE0, 0xFF, 0xFF)}, diff --git a/src/testdir/Make_all.mak b/src/testdir/Make_all.mak index 02f2611086..0ed91d76f4 100644 --- a/src/testdir/Make_all.mak +++ b/src/testdir/Make_all.mak @@ -102,7 +102,6 @@ SCRIPTS_ALL = \ test_marks.out \ test_nested_function.out \ test_search_mbyte.out \ - test_signs.out \ test_tagcase.out \ test_utf8.out \ test_wordcount.out \ @@ -184,6 +183,7 @@ NEW_TESTS = test_arglist.res \ test_perl.res \ test_quickfix.res \ test_ruby.res \ + test_signs.res \ test_startup.res \ test_stat.res \ test_syntax.res \ diff --git a/src/testdir/shared.vim b/src/testdir/shared.vim index aba428a46d..edc3c386a8 100644 --- a/src/testdir/shared.vim +++ b/src/testdir/shared.vim @@ -130,7 +130,7 @@ endfunc " Plugins are not loaded, unless 'loadplugins' is set in "before". " Return 1 if Vim could be executed. func RunVim(before, after, arguments) - call RunVimPiped(a:before, a:after, a:arguments, '') + return RunVimPiped(a:before, a:after, a:arguments, '') endfunc func RunVimPiped(before, after, arguments, pipecmd) diff --git a/src/testdir/test_glob2regpat.vim b/src/testdir/test_glob2regpat.vim index 250ab2746c..16d7224256 100644 --- a/src/testdir/test_glob2regpat.vim +++ b/src/testdir/test_glob2regpat.vim @@ -2,9 +2,25 @@ func Test_invalid() call assert_fails('call glob2regpat(1.33)', 'E806:') + call assert_fails('call glob2regpat("}")', 'E219:') + call assert_fails('call glob2regpat("{")', 'E220:') endfunc func Test_valid() call assert_equal('^foo\.', glob2regpat('foo.*')) + call assert_equal('^foo.$', glob2regpat('foo?')) call assert_equal('\.vim$', glob2regpat('*.vim')) + call assert_equal('^[abc]$', glob2regpat('[abc]')) + call assert_equal('^foo bar$', glob2regpat('foo\ bar')) + call assert_equal('^foo,bar$', glob2regpat('foo,bar')) + call assert_equal('^\(foo\|bar\)$', glob2regpat('{foo,bar}')) + call assert_equal('.*', glob2regpat('**')) + + if has('unix') + call assert_equal('^foo?$', glob2regpat('foo\?')) + call assert_equal('^\(foo,bar\|foobar\)$', glob2regpat('{foo\,bar,foobar}')) + call assert_equal('^{foo,bar}$', glob2regpat('\{foo,bar\}')) + call assert_equal('^\\\(foo\|bar\\\)$', glob2regpat('\\{foo,bar\\}')) + " todo: Windows + endif endfunc diff --git a/src/testdir/test_signs.in b/src/testdir/test_signs.in deleted file mode 100644 index a2f15e9323..0000000000 --- a/src/testdir/test_signs.in +++ /dev/null @@ -1,22 +0,0 @@ -Tests for signs -STARTTEST -:so small.vim -:if !has("signs") -: e! test.ok -: wq! test.out -:endif -:" -:sign define JumpSign text=x -:exe 'sign place 42 line=2 name=JumpSign buffer=' . bufnr('') -:" Split the window to the bottom to verify :sign-jump will stay in the current -:" window if the buffer is displayed there -:bot split -:exe 'sign jump 42 buffer=' . bufnr('') -:call append(line('$'), winnr()) -:$-1,$w! test.out -ENDTEST - -STARTTEST -:qa! -ENDTEST - diff --git a/src/testdir/test_signs.ok b/src/testdir/test_signs.ok deleted file mode 100644 index 1f8c977ecc..0000000000 --- a/src/testdir/test_signs.ok +++ /dev/null @@ -1,2 +0,0 @@ - -2 diff --git a/src/testdir/test_signs.vim b/src/testdir/test_signs.vim new file mode 100644 index 0000000000..f280a3161e --- /dev/null +++ b/src/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 diff --git a/src/testdir/test_timers.vim b/src/testdir/test_timers.vim index fb35f61fff..f334c17464 100644 --- a/src/testdir/test_timers.vim +++ b/src/testdir/test_timers.vim @@ -27,7 +27,7 @@ func Test_repeat_three() let timer = timer_start(50, 'MyHandler', {'repeat': 3}) let slept = WaitFor('g:val == 3') call assert_equal(3, g:val) - call assert_inrange(100, 250, slept) + call assert_inrange(80, 200, slept) endfunc func Test_repeat_many() diff --git a/src/version.c b/src/version.c index 0d430cb40e..3b784b3958 100644 --- a/src/version.c +++ b/src/version.c @@ -778,6 +778,18 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ +/**/ + 2187, +/**/ + 2186, +/**/ + 2185, +/**/ + 2184, +/**/ + 2183, +/**/ + 2182, /**/ 2181, /**/