annotate src/testdir/test_ruby.in @ 7473:ef60fac8f3eb v7.4.1039

commit https://github.com/vim/vim/commit/d798af8c77cf47dba74b6b69ae4eba904023981c Author: Bram Moolenaar <Bram@vim.org> Date: Sun Jan 3 14:32:41 2016 +0100 patch 7.4.1039 Problem: Test 31 fails with small build. Solution: Bail out for small build. (Hirohito Higashi)
author Christian Brabandt <cb@256bit.org>
date Sun, 03 Jan 2016 14:45:05 +0100
parents 18ec2c5a5ce7
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
6847
18ec2c5a5ce7 patch 7.4.744
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
1 Tests for ruby interface. vim: set ft=vim :
18ec2c5a5ce7 patch 7.4.744
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
2
18ec2c5a5ce7 patch 7.4.744
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
3 STARTTEST
18ec2c5a5ce7 patch 7.4.744
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
4 :so small.vim
18ec2c5a5ce7 patch 7.4.744
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
5 :set nocompatible viminfo+=nviminfo
18ec2c5a5ce7 patch 7.4.744
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
6 :if !has('ruby') | e! test.ok | wq! test.out | endif
18ec2c5a5ce7 patch 7.4.744
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
7 :" change buffer contents
18ec2c5a5ce7 patch 7.4.744
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
8 :ruby VIM.command("normal /^1\n")
18ec2c5a5ce7 patch 7.4.744
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
9 :ruby $curbuf.line = "1 changed line 1"
18ec2c5a5ce7 patch 7.4.744
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
10 :" evaluate a List
18ec2c5a5ce7 patch 7.4.744
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
11 :ruby VIM.command("normal /^2\n")
18ec2c5a5ce7 patch 7.4.744
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
12 :let l = ["abc", "def"]
18ec2c5a5ce7 patch 7.4.744
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
13 :ruby << EOF
18ec2c5a5ce7 patch 7.4.744
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
14 curline = $curbuf.line_number
18ec2c5a5ce7 patch 7.4.744
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
15 l = VIM.evaluate("l");
18ec2c5a5ce7 patch 7.4.744
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
16 $curbuf.append(curline, l.join("\n"))
18ec2c5a5ce7 patch 7.4.744
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
17 EOF
18ec2c5a5ce7 patch 7.4.744
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
18 :normal j
18ec2c5a5ce7 patch 7.4.744
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
19 :.rubydo $_ = $_.gsub(/\n/, '/')
18ec2c5a5ce7 patch 7.4.744
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
20 :?^1?,$w! test.out
18ec2c5a5ce7 patch 7.4.744
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
21 :qa!
18ec2c5a5ce7 patch 7.4.744
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
22 ENDTEST
18ec2c5a5ce7 patch 7.4.744
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
23
18ec2c5a5ce7 patch 7.4.744
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
24 1 line 1
18ec2c5a5ce7 patch 7.4.744
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
25 2 line 2