comparison 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
comparison
equal deleted inserted replaced
7654:c36e4cba489a 7655:94f34dc2f254
2 2
3 if !has('perl') 3 if !has('perl')
4 finish 4 finish
5 end 5 end
6 6
7 set nocp viminfo+=nviminfo 7 func Test_change_buffer()
8 call setline(line('$'), ['1 line 1'])
9 perl VIM::DoCommand("normal /^1\n")
10 perl $curline = VIM::Eval("line('.')")
11 perl $curbuf->Set($curline, "1 changed line 1")
12 call assert_equal('1 changed line 1', getline('$'))
13 endfunc
14
15 func Test_evaluate_list()
16 call setline(line('$'), ['2 line 2'])
17 perl VIM::DoCommand("normal /^2\n")
18 perl $curline = VIM::Eval("line('.')")
19 let l = ["abc", "def"]
20 perl << EOF
21 $l = VIM::Eval("l");
22 $curbuf->Append($curline, $l);
23 EOF
24 normal j
25 .perldo s|\n|/|g
26 call assert_equal('abc/def/', getline('$'))
27 endfunc
8 28
9 fu <SID>catch_peval(expr) 29 fu <SID>catch_peval(expr)
10 try 30 try
11 call perleval(a:expr) 31 call perleval(a:expr)
12 catch 32 catch