diff src/testdir/test_quickfix.vim @ 24590:2818f846f099 v8.2.2834

patch 8.2.2834: Vim9: :cexpr does not work with local variables Commit: https://github.com/vim/vim/commit/5f7d4c049e934dbc8d2c3f2720797c10ee3c55c2 Author: Bram Moolenaar <Bram@vim.org> Date: Wed May 5 21:31:39 2021 +0200 patch 8.2.2834: Vim9: :cexpr does not work with local variables Problem: Vim9: :cexpr does not work with local variables. Solution: Compile :cexpr.
author Bram Moolenaar <Bram@vim.org>
date Wed, 05 May 2021 21:45:04 +0200
parents 192058cad081
children 437b8be91993
line wrap: on
line diff
--- a/src/testdir/test_quickfix.vim
+++ b/src/testdir/test_quickfix.vim
@@ -722,6 +722,22 @@ def Test_helpgrep_vim9_restore_cpo()
   helpclose
 enddef
 
+def Test_vim9_cexpr()
+  var text = 'somefile:95:error'
+  cexpr text
+  var l = getqflist()
+  assert_equal(1, l->len())
+  assert_equal(95, l[0].lnum)
+  assert_equal('error', l[0].text)
+
+  text = 'somefile:77:warning'
+  caddexpr text
+  l = getqflist()
+  assert_equal(2, l->len())
+  assert_equal(77, l[1].lnum)
+  assert_equal('warning', l[1].text)
+enddef
+
 func Test_errortitle()
   augroup QfBufWinEnter
     au!