diff options
author | zeertzjq <zeertzjq@outlook.com> | 2023-04-29 08:12:32 +0800 |
---|---|---|
committer | zeertzjq <zeertzjq@outlook.com> | 2023-04-29 09:20:52 +0800 |
commit | 4bcf8c15b3079ca72d6557890b50b35565fcd577 (patch) | |
tree | cc6a986bd307aec948e1f696f6755c5874e1b451 /test/old/testdir/test_ruby.vim | |
parent | 291fd767e3979b25146c32115eacc3c2f8e1e517 (diff) | |
download | rneovim-4bcf8c15b3079ca72d6557890b50b35565fcd577.tar.gz rneovim-4bcf8c15b3079ca72d6557890b50b35565fcd577.tar.bz2 rneovim-4bcf8c15b3079ca72d6557890b50b35565fcd577.zip |
vim-patch:8.2.0578: heredoc for interfaces does not support "trim"
Problem: Heredoc for interfaces does not support "trim".
Solution: Update the script heredoc support to be same as the :let command.
(Yegappan Lakshmanan, closes vim/vim#5916)
https://github.com/vim/vim/commit/6c2b7b8055b96463f78abb70f58c4c6d6d4b9d55
Diffstat (limited to 'test/old/testdir/test_ruby.vim')
-rw-r--r-- | test/old/testdir/test_ruby.vim | 27 |
1 files changed, 22 insertions, 5 deletions
diff --git a/test/old/testdir/test_ruby.vim b/test/old/testdir/test_ruby.vim index 1fbf3392d9..80d39309ea 100644 --- a/test/old/testdir/test_ruby.vim +++ b/test/old/testdir/test_ruby.vim @@ -341,11 +341,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("|")) -EOF + ruby << trim EOF + curline = $curbuf.line_number + l = Vim.evaluate("l"); + $curbuf.append(curline, l.join("|")) + EOF normal j .rubydo $_ = $_.gsub(/\|/, '/') call assert_equal('abc/def', getline('$')) @@ -414,4 +414,21 @@ func Test_rubyeval_error() call assert_fails('call rubyeval("(")') 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 |