From 6c2b7b8055b96463f78abb70f58c4c6d6d4b9d55 Mon Sep 17 00:00:00 2001 From: Bram Moolenaar Date: Tue, 14 Apr 2020 20:15:49 +0200 Subject: 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) --- src/testdir/test_python3.vim | 33 +++++++++++++++++++++++++++------ 1 file changed, 27 insertions(+), 6 deletions(-) (limited to 'src/testdir/test_python3.vim') diff --git a/src/testdir/test_python3.vim b/src/testdir/test_python3.vim index 60ca1ee3f..224484611 100644 --- a/src/testdir/test_python3.vim +++ b/src/testdir/test_python3.vim @@ -295,9 +295,11 @@ func Test_python3_opt_reset_local_to_global() " Set the global and buffer-local option values and then clear the " buffer-local option value. for opt in bopts - py3 pyopt = vim.bindeval("opt") - py3 vim.options[pyopt[0]] = pyopt[1] - py3 curbuf.options[pyopt[0]] = pyopt[2] + py3 << trim END + pyopt = vim.bindeval("opt") + vim.options[pyopt[0]] = pyopt[1] + curbuf.options[pyopt[0]] = pyopt[2] + END exe "call assert_equal(opt[2], &" .. opt[0] .. ")" exe "call assert_equal(opt[1], &g:" .. opt[0] .. ")" exe "call assert_equal(opt[2], &l:" .. opt[0] .. ")" @@ -315,9 +317,11 @@ func Test_python3_opt_reset_local_to_global() \ ['sidescrolloff', 6, 12, -1], \ ['statusline', '%<%f', '%<%F', '']] for opt in wopts - py3 pyopt = vim.bindeval("opt") - py3 vim.options[pyopt[0]] = pyopt[1] - py3 curwin.options[pyopt[0]] = pyopt[2] + py3 << trim + pyopt = vim.bindeval("opt") + vim.options[pyopt[0]] = pyopt[1] + curwin.options[pyopt[0]] = pyopt[2] + . exe "call assert_equal(opt[2], &" .. opt[0] .. ")" exe "call assert_equal(opt[1], &g:" .. opt[0] .. ")" exe "call assert_equal(opt[2], &l:" .. opt[0] .. ")" @@ -331,4 +335,21 @@ func Test_python3_opt_reset_local_to_global() close! endfunc +" Test for various heredoc syntax +func Test_python3_heredoc() + python3 << END +s='A' +END + python3 << +s+='B' +. + python3 << trim END + s+='C' + END + python3 << trim + s+='D' + . + call assert_equal('ABCD', pyxeval('s')) +endfunc + " vim: shiftwidth=2 sts=2 expandtab -- cgit v1.2.1