forked from aniani/vim
patch 8.2.2120: not all Perl functionality is tested
Problem: Not all Perl functionality is tested. Solution: Add a few more test cases. (Dominique Pellé, closes #7440)
This commit is contained in:
@@ -182,9 +182,21 @@ func Test_perleval()
|
||||
|
||||
call assert_equal('*VIM', perleval('"*VIM"'))
|
||||
call assert_true(perleval('\\0') =~ 'SCALAR(0x\x\+)')
|
||||
|
||||
" typeglob
|
||||
call assert_equal('*main::STDOUT', perleval('*STDOUT'))
|
||||
'
|
||||
call perleval("++-$foo")
|
||||
let messages = split(execute('message'), "\n")
|
||||
call assert_match("Can't modify negation", messages[-1])
|
||||
endfunc
|
||||
|
||||
func Test_perldo()
|
||||
new
|
||||
" :perldo in empty buffer does nothing.
|
||||
perldo ++$counter
|
||||
call assert_equal(0, perleval("$counter"))
|
||||
|
||||
sp __TEST__
|
||||
exe 'read ' g:testname
|
||||
perldo s/perl/vieux_chameau/g
|
||||
@@ -204,8 +216,7 @@ func Test_perldo()
|
||||
call setline(1, ['one', 'two', 'three'])
|
||||
perldo VIM::DoCommand("new")
|
||||
call assert_equal(wincount + 1, winnr('$'))
|
||||
bwipe!
|
||||
bwipe!
|
||||
%bwipe!
|
||||
endfunc
|
||||
|
||||
func Test_VIM_package()
|
||||
@@ -311,4 +322,10 @@ VIM::DoCommand('let s ..= "B"')
|
||||
call assert_equal('ABCDE', s)
|
||||
endfunc
|
||||
|
||||
func Test_perl_in_sandbox()
|
||||
sandbox perl print 'test'
|
||||
let messages = split(execute('message'), "\n")
|
||||
call assert_match("'print' trapped by operation mask", messages[-1])
|
||||
endfunc
|
||||
|
||||
" vim: shiftwidth=2 sts=2 expandtab
|
||||
|
@@ -750,6 +750,8 @@ static char *(features[]) =
|
||||
|
||||
static int included_patches[] =
|
||||
{ /* Add new patch number below this line */
|
||||
/**/
|
||||
2120,
|
||||
/**/
|
||||
2119,
|
||||
/**/
|
||||
|
Reference in New Issue
Block a user