changeset 23148:4637f7a4c753 v8.2.2120

patch 8.2.2120: not all Perl functionality is tested Commit: https://github.com/vim/vim/commit/730677a0dafe6f2e72888ef59f74f66f2d0a573e Author: Bram Moolenaar <Bram@vim.org> Date: Wed Dec 9 16:05:45 2020 +0100 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 https://github.com/vim/vim/issues/7440)
author Bram Moolenaar <Bram@vim.org>
date Wed, 09 Dec 2020 16:15:03 +0100
parents 317de3a50fb8
children e427a5961456
files src/testdir/test_perl.vim src/version.c
diffstat 2 files changed, 21 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/src/testdir/test_perl.vim
+++ b/src/testdir/test_perl.vim
@@ -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
--- a/src/version.c
+++ b/src/version.c
@@ -751,6 +751,8 @@ static char *(features[]) =
 static int included_patches[] =
 {   /* Add new patch number below this line */
 /**/
+    2120,
+/**/
     2119,
 /**/
     2118,