mirror of
https://github.com/vim/vim.git
synced 2025-10-06 05:44:14 -04:00
patch 8.2.2847: Perl not tested sufficiently
Problem: Perl not tested sufficiently. Solution: Add test. Also test W17. (Dominique Pellé, closes #8193)
This commit is contained in:
committed by
Bram Moolenaar
parent
68db996b62
commit
588cf7547b
@@ -584,4 +584,12 @@ func Test_arabic_chars_in_search_cmd()
|
|||||||
bwipe!
|
bwipe!
|
||||||
endfunc
|
endfunc
|
||||||
|
|
||||||
|
func Test_W17_arabic_requires_utf8()
|
||||||
|
let save_enc = &encoding
|
||||||
|
set encoding=latin1 arabic
|
||||||
|
call assert_match('^W17:', GetMessages()[-1])
|
||||||
|
set arabic&
|
||||||
|
let &encoding = save_enc
|
||||||
|
endfunc
|
||||||
|
|
||||||
" vim: shiftwidth=2 sts=2 expandtab
|
" vim: shiftwidth=2 sts=2 expandtab
|
||||||
|
@@ -1,6 +1,7 @@
|
|||||||
" Tests for Perl interface
|
" Tests for Perl interface
|
||||||
|
|
||||||
source check.vim
|
source check.vim
|
||||||
|
source shared.vim
|
||||||
CheckFeature perl
|
CheckFeature perl
|
||||||
|
|
||||||
" FIXME: RunTest don't see any error when Perl abort...
|
" FIXME: RunTest don't see any error when Perl abort...
|
||||||
@@ -52,6 +53,11 @@ func Test_buffer_Append()
|
|||||||
perl @l = ('5' ..'7')
|
perl @l = ('5' ..'7')
|
||||||
perl $curbuf->Append(0, @l)
|
perl $curbuf->Append(0, @l)
|
||||||
call assert_equal(['5', '6', '7', '', '1', '2', '3', '4'], getline(1, '$'))
|
call assert_equal(['5', '6', '7', '', '1', '2', '3', '4'], getline(1, '$'))
|
||||||
|
|
||||||
|
perl $curbuf->Append(0)
|
||||||
|
call assert_match('^Usage: VIBUF::Append(vimbuf, lnum, @lines) at .* line 1\.$',
|
||||||
|
\ GetMessages()[-1])
|
||||||
|
|
||||||
bwipe!
|
bwipe!
|
||||||
endfunc
|
endfunc
|
||||||
|
|
||||||
@@ -61,6 +67,11 @@ func Test_buffer_Set()
|
|||||||
perl $curbuf->Set(2, 'a', 'b', 'c')
|
perl $curbuf->Set(2, 'a', 'b', 'c')
|
||||||
perl $curbuf->Set(4, 'A', 'B', 'C')
|
perl $curbuf->Set(4, 'A', 'B', 'C')
|
||||||
call assert_equal(['1', 'a', 'b', 'A', 'B'], getline(1, '$'))
|
call assert_equal(['1', 'a', 'b', 'A', 'B'], getline(1, '$'))
|
||||||
|
|
||||||
|
perl $curbuf->Set(0)
|
||||||
|
call assert_match('^Usage: VIBUF::Set(vimbuf, lnum, @lines) at .* line 1\.$',
|
||||||
|
\ GetMessages()[-1])
|
||||||
|
|
||||||
bwipe!
|
bwipe!
|
||||||
endfunc
|
endfunc
|
||||||
|
|
||||||
@@ -210,6 +221,13 @@ func Test_perldo()
|
|||||||
perldo VIM::DoCommand("%d_")
|
perldo VIM::DoCommand("%d_")
|
||||||
bwipe!
|
bwipe!
|
||||||
|
|
||||||
|
" Check a Perl expression which gives an error.
|
||||||
|
new
|
||||||
|
call setline(1, 'one')
|
||||||
|
perldo 1/0
|
||||||
|
call assert_match('^Illegal division by zero at .* line 1\.$', GetMessages()[-1])
|
||||||
|
bwipe!
|
||||||
|
|
||||||
" Check switching to another buffer does not trigger ml_get error.
|
" Check switching to another buffer does not trigger ml_get error.
|
||||||
new
|
new
|
||||||
let wincount = winnr('$')
|
let wincount = winnr('$')
|
||||||
@@ -231,12 +249,13 @@ endfunc
|
|||||||
func Test_stdio()
|
func Test_stdio()
|
||||||
redir =>l:out
|
redir =>l:out
|
||||||
perl << trim EOF
|
perl << trim EOF
|
||||||
VIM::Msg("&VIM::Msg");
|
VIM::Msg("VIM::Msg");
|
||||||
|
VIM::Msg("VIM::Msg Error", "Error");
|
||||||
print "STDOUT";
|
print "STDOUT";
|
||||||
print STDERR "STDERR";
|
print STDERR "STDERR";
|
||||||
EOF
|
EOF
|
||||||
redir END
|
redir END
|
||||||
call assert_equal(['&VIM::Msg', 'STDOUT', 'STDERR'], split(l:out, "\n"))
|
call assert_equal(['VIM::Msg', 'VIM::Msg Error', 'STDOUT', 'STDERR'], split(l:out, "\n"))
|
||||||
endfunc
|
endfunc
|
||||||
|
|
||||||
" Run first to get a clean namespace
|
" Run first to get a clean namespace
|
||||||
|
@@ -750,6 +750,8 @@ static char *(features[]) =
|
|||||||
|
|
||||||
static int included_patches[] =
|
static int included_patches[] =
|
||||||
{ /* Add new patch number below this line */
|
{ /* Add new patch number below this line */
|
||||||
|
/**/
|
||||||
|
2847,
|
||||||
/**/
|
/**/
|
||||||
2846,
|
2846,
|
||||||
/**/
|
/**/
|
||||||
|
Reference in New Issue
Block a user