Bram Moolenaar | cf0213e | 2015-06-19 15:45:29 +0200 | [diff] [blame^] | 1 | Tests for perl interface. vim: set ft=vim : |
| 2 | |
| 3 | STARTTEST |
| 4 | :so small.vim |
| 5 | :set nocompatible viminfo+=nviminfo |
| 6 | :if !has('perl') | e! test.ok | wq! test.out | endif |
| 7 | :" change buffer contents |
| 8 | :perl VIM::DoCommand("normal /^1\n") |
| 9 | :perl $curline = VIM::Eval("line('.')") |
| 10 | :perl $curbuf->Set($curline, "1 changed line 1") |
| 11 | :" evaluate a List |
| 12 | :perl VIM::DoCommand("normal /^2\n") |
| 13 | :perl $curline = VIM::Eval("line('.')") |
| 14 | :let l = ["abc", "def"] |
| 15 | :perl << EOF |
| 16 | $l = VIM::Eval("l"); |
| 17 | $curbuf->Append($curline, $l); |
| 18 | EOF |
| 19 | :normal j |
| 20 | :.perldo s|\n|/|g |
| 21 | :?^1?,$w! test.out |
| 22 | :qa! |
| 23 | ENDTEST |
| 24 | |
| 25 | 1 line 1 |
| 26 | 2 line 2 |