diff src/testdir/test_vim9_disassemble.vim @ 24826:a8d64f1a223b v8.2.2951

patch 8.2.2951: Vim9: cannot use heredoc for :python, :lua, etc. Commit: https://github.com/vim/vim/commit/2067733b5c76e996238af938af36b8196366b7ce Author: Bram Moolenaar <Bram@vim.org> Date: Sun Jun 6 17:02:53 2021 +0200 patch 8.2.2951: Vim9: cannot use heredoc for :python, :lua, etc. Problem: Vim9: cannot use heredoc in :def function for :python, :lua, etc. Solution: Concatenate the heredoc lines and pass them in the ISN_EXEC_SPLIT instruction.
author Bram Moolenaar <Bram@vim.org>
date Sun, 06 Jun 2021 17:15:03 +0200
parents 7c1375eb1636
children e61a2085c89b
line wrap: on
line diff
--- a/src/testdir/test_vim9_disassemble.vim
+++ b/src/testdir/test_vim9_disassemble.vim
@@ -121,6 +121,23 @@ def Test_disassemble_exec_expr()
         res)
 enddef
 
+if has('python3')
+  def s:PyHeredoc()
+    python3 << EOF
+      print('hello')
+EOF
+  enddef
+
+  def Test_disassemble_python_heredoc()
+    var res = execute('disass s:PyHeredoc')
+    assert_match('<SNR>\d*_PyHeredoc.*' ..
+          "    python3 << EOF^@      print('hello')^@EOF\\_s*" ..
+          '\d EXEC_SPLIT     python3 << EOF^@      print(''hello'')^@EOF\_s*' ..
+          '\d RETURN 0',
+          res)
+  enddef
+endif
+
 def s:Substitute()
   var expr = "abc"
   :%s/a/\=expr/&g#c