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)
This commit is contained in:
Bram Moolenaar
2020-04-14 20:15:49 +02:00
parent 7a1637f4c0
commit 6c2b7b8055
22 changed files with 2093 additions and 1926 deletions
+21 -2
View File
@@ -67,11 +67,11 @@ func Test_vim_buffer()
" 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 @@ func Test_set_cursor()
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