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 #5916)
diff --git a/src/testdir/test_tcl.vim b/src/testdir/test_tcl.vim
index d25c7f1..7045fc2 100644
--- a/src/testdir/test_tcl.vim
+++ b/src/testdir/test_tcl.vim
@@ -67,11 +67,11 @@
" Test ::vim::buffer list
call assert_equal('2', TclEval('llength [::vim::buffer list]'))
call assert_equal(b1.' '.b2, TclEval('::vim::buffer list'))
- tcl <<EOF
+ tcl << trim EOF
proc eachbuf { cmd } {
foreach b [::vim::buffer list] { $b command $cmd }
}
-EOF
+ EOF
tcl eachbuf %s/foo/FOO/g
b! Xfoo1
call assert_equal(['FOObar'], getline(1, '$'))
@@ -680,3 +680,22 @@
normal j
call assert_equal([2, 5], [line('.'), col('.')])
endfunc
+
+" Test for different syntax for ruby heredoc
+func Test_tcl_heredoc()
+ tcl << END
+::vim::command {let s = "A"}
+END
+ tcl <<
+::vim::command {let s ..= "B"}
+.
+ tcl << trim END
+ ::vim::command {let s ..= "C"}
+ END
+ tcl << trim
+ ::vim::command {let s ..= "D"}
+ .
+ call assert_equal('ABCD', s)
+endfunc
+
+" vim: shiftwidth=2 sts=2 expandtab