Mercurial > vim
diff src/testdir/test_perl.vim @ 7655:94f34dc2f254 v7.4.1127
commit https://github.com/vim/vim/commit/021b593e7ed6c7111cbf189744ad1e5d6c4a7d79
Author: Bram Moolenaar <Bram@vim.org>
Date: Sun Jan 17 22:05:48 2016 +0100
patch 7.4.1127
Problem: Both old and new style tests for Perl.
Solution: Merge the old tests with the new style tests.
author | Christian Brabandt <cb@256bit.org> |
---|---|
date | Sun, 17 Jan 2016 22:15:04 +0100 |
parents | c7575b07de98 |
children | 54a380c74547 |
line wrap: on
line diff
--- a/src/testdir/test_perl.vim +++ b/src/testdir/test_perl.vim @@ -4,7 +4,27 @@ if !has('perl') finish end -set nocp viminfo+=nviminfo +func Test_change_buffer() + call setline(line('$'), ['1 line 1']) + perl VIM::DoCommand("normal /^1\n") + perl $curline = VIM::Eval("line('.')") + perl $curbuf->Set($curline, "1 changed line 1") + call assert_equal('1 changed line 1', getline('$')) +endfunc + +func Test_evaluate_list() + call setline(line('$'), ['2 line 2']) + perl VIM::DoCommand("normal /^2\n") + perl $curline = VIM::Eval("line('.')") + let l = ["abc", "def"] + perl << EOF + $l = VIM::Eval("l"); + $curbuf->Append($curline, $l); +EOF + normal j + .perldo s|\n|/|g + call assert_equal('abc/def/', getline('$')) +endfunc fu <SID>catch_peval(expr) try