aboutsummaryrefslogtreecommitdiff
path: root/test/old/testdir/test_python3.vim
diff options
context:
space:
mode:
authorzeertzjq <zeertzjq@outlook.com>2023-04-29 08:12:32 +0800
committerzeertzjq <zeertzjq@outlook.com>2023-04-29 09:20:52 +0800
commit4bcf8c15b3079ca72d6557890b50b35565fcd577 (patch)
treecc6a986bd307aec948e1f696f6755c5874e1b451 /test/old/testdir/test_python3.vim
parent291fd767e3979b25146c32115eacc3c2f8e1e517 (diff)
downloadrneovim-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_python3.vim')
-rw-r--r--test/old/testdir/test_python3.vim33
1 files changed, 27 insertions, 6 deletions
diff --git a/test/old/testdir/test_python3.vim b/test/old/testdir/test_python3.vim
index 6c9676603f..60773c5b2a 100644
--- a/test/old/testdir/test_python3.vim
+++ b/test/old/testdir/test_python3.vim
@@ -227,9 +227,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] .. ")"
@@ -247,9 +249,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] .. ")"
@@ -263,4 +267,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