summaryrefslogtreecommitdiff
path: root/src/testdir/test_ruby.vim
diff options
context:
space:
mode:
Diffstat (limited to 'src/testdir/test_ruby.vim')
-rw-r--r--src/testdir/test_ruby.vim29
1 files changed, 24 insertions, 5 deletions
diff --git a/src/testdir/test_ruby.vim b/src/testdir/test_ruby.vim
index de9c86aab..c816fad8a 100644
--- a/src/testdir/test_ruby.vim
+++ b/src/testdir/test_ruby.vim
@@ -332,11 +332,11 @@ func Test_ruby_Vim_evaluate_list()
call setline(line('$'), ['2 line 2'])
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
+ ruby << trim EOF
+ curline = $curbuf.line_number
+ l = Vim.evaluate("l");
+ $curbuf.append(curline, l.join("\n"))
+ EOF
normal j
.rubydo $_ = $_.gsub(/\n/, '/')
call assert_equal('abc/def', getline('$'))
@@ -394,3 +394,22 @@ func Test_ruby_p()
let messages = split(execute('message'), "\n")
call assert_equal(0, len(messages))
endfunc
+
+" Test for various heredoc syntax
+func Test_ruby_heredoc()
+ ruby << END
+Vim.command('let s = "A"')
+END
+ ruby <<
+Vim.command('let s ..= "B"')
+.
+ ruby << trim END
+ Vim.command('let s ..= "C"')
+ END
+ ruby << trim
+ Vim.command('let s ..= "D"')
+ .
+ call assert_equal('ABCD', s)
+endfunc
+
+" vim: shiftwidth=2 sts=2 expandtab