view src/testdir/test_ruby.in @ 8895:7f29248d5789 v7.4.1734

commit https://github.com/vim/vim/commit/0f518a8f4d4be4cac10389680f6bd5e3781f94b0 Author: Bram Moolenaar <Bram@vim.org> Date: Thu Apr 14 16:57:10 2016 +0200 patch 7.4.1734 Problem: Test fails when not using utf-8. Solution: Split test in regularand utf-8 part.
author Christian Brabandt <cb@256bit.org>
date Thu, 14 Apr 2016 17:00:05 +0200
parents 18ec2c5a5ce7
children
line wrap: on
line source

Tests for ruby interface.     vim: set ft=vim :

STARTTEST
:so small.vim
:set nocompatible viminfo+=nviminfo
:if !has('ruby') | e! test.ok | wq! test.out | endif
:" change buffer contents
:ruby VIM.command("normal /^1\n")
:ruby $curbuf.line = "1 changed line 1"
:" evaluate a List
:ruby VIM.command("normal /^2\n")
:let l = ["abc", "def"]
:ruby << EOF
curline = $curbuf.line_number
l = VIM.evaluate("l");
$curbuf.append(curline, l.join("\n"))
EOF
:normal j
:.rubydo $_ = $_.gsub(/\n/, '/')
:?^1?,$w! test.out
:qa!
ENDTEST

1 line 1
2 line 2