diff src/testdir/test_vim9_expr.vim @ 31663:2f8a3cde553f v9.0.1164

patch 9.0.1164: evaluating string expression advances function line Commit: https://github.com/vim/vim/commit/01c5f2addf86b8d8940d71c92f6219f14a6df99e Author: h-east <h.east.727@gmail.com> Date: Mon Jan 9 15:10:40 2023 +0000 patch 9.0.1164: evaluating string expression advances function line Problem: Evaluating string expression advances function line. Solution: Disable function lines while parsing a string expression. (Hirohito Higashi, closes #11796)
author Bram Moolenaar <Bram@vim.org>
date Mon, 09 Jan 2023 16:15:03 +0100
parents 67d9fbe516a3
children dbec60b8c253
line wrap: on
line diff
--- a/src/testdir/test_vim9_expr.vim
+++ b/src/testdir/test_vim9_expr.vim
@@ -3700,6 +3700,17 @@ def Test_expr9_method_call_linebreak()
       assert_equal('', v:errmsg)
   END
   v9.CheckScriptSuccess(lines)
+
+  # this was skipping over the expression without an error
+  lines =<< trim END
+      vim9script
+      def Test(s: string): string
+        return substitute(s, 'A', '\=toupper("x")', 'g')
+                          ->tolower()
+      enddef
+      assert_equal('xbcd', Test('ABCD'))
+  END
+  v9.CheckScriptSuccess(lines)
 enddef
 
 def Test_expr9_method_call_import()