Skip to content

Commit 730677a

Browse files
committed
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)
1 parent 7988a6f commit 730677a

2 files changed

Lines changed: 21 additions & 2 deletions

File tree

src/testdir/test_perl.vim

Lines changed: 19 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -182,9 +182,21 @@ func Test_perleval()
182182

183183
call assert_equal('*VIM', perleval('"*VIM"'))
184184
call assert_true(perleval('\\0') =~ 'SCALAR(0x\x\+)')
185+
186+
" typeglob
187+
call assert_equal('*main::STDOUT', perleval('*STDOUT'))
188+
'
189+
call perleval("++-$foo")
190+
let messages = split(execute('message'), "\n")
191+
call assert_match("Can't modify negation", messages[-1])
185192
endfunc
186193

187194
func Test_perldo()
195+
new
196+
" :perldo in empty buffer does nothing.
197+
perldo ++$counter
198+
call assert_equal(0, perleval("$counter"))
199+
188200
sp __TEST__
189201
exe 'read ' g:testname
190202
perldo s/perl/vieux_chameau/g
@@ -204,8 +216,7 @@ func Test_perldo()
204216
call setline(1, ['one', 'two', 'three'])
205217
perldo VIM::DoCommand("new")
206218
call assert_equal(wincount + 1, winnr('$'))
207-
bwipe!
208-
bwipe!
219+
%bwipe!
209220
endfunc
210221

211222
func Test_VIM_package()
@@ -311,4 +322,10 @@ VIM::DoCommand('let s ..= "B"')
311322
call assert_equal('ABCDE', s)
312323
endfunc
313324

325+
func Test_perl_in_sandbox()
326+
sandbox perl print 'test'
327+
let messages = split(execute('message'), "\n")
328+
call assert_match("'print' trapped by operation mask", messages[-1])
329+
endfunc
330+
314331
" vim: shiftwidth=2 sts=2 expandtab

src/version.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -750,6 +750,8 @@ static char *(features[]) =
750750

751751
static int included_patches[] =
752752
{ /* Add new patch number below this line */
753+
/**/
754+
2120,
753755
/**/
754756
2119,
755757
/**/

0 commit comments

Comments
 (0)