Patch 8.2.4243
Problem:    Lua tests fail with Lua 5.4.4.
Solution:   Check messages like before Lua 5.4.3. (Jakub KulĂ­k, closes #9652)
Files:      src/testdir/test_lua.vim


*** ../vim-8.2.4242/src/testdir/test_lua.vim    2021-08-06 20:34:34.626972208 
+0100
--- src/testdir/test_lua.vim    2022-01-28 17:18:04.860740591 +0000
***************
*** 15,27 ****
  " Depending on the lua version, the error messages are different.
  let [s:major, s:minor, s:patch] = 
luaeval('vim.lua_version')->split('\.')->map({-> str2nr(v:val)})
  let s:lua_53_or_later = 0
! let s:lua_543_or_later = 0
  if (s:major == 5 && s:minor >= 3) || s:major > 5
    let s:lua_53_or_later = 1
!   if (s:major == 5
!         \ && ((s:minor == 4 && s:patch >= 3) || s:minor > 4))
!         \ || s:major > 5
!     let s:lua_543_or_later = 1
    endif
  endif
  
--- 15,25 ----
  " Depending on the lua version, the error messages are different.
  let [s:major, s:minor, s:patch] = 
luaeval('vim.lua_version')->split('\.')->map({-> str2nr(v:val)})
  let s:lua_53_or_later = 0
! let s:lua_543 = 0
  if (s:major == 5 && s:minor >= 3) || s:major > 5
    let s:lua_53_or_later = 1
!   if s:major == 5 && s:minor == 4 && s:patch == 3
!     let s:lua_543 = 1
    endif
  endif
  
***************
*** 59,65 ****
    " Error cases
    call assert_fails('luado string.format()',
          \ "[string \"vim chunk\"]:1: bad argument #1 to 'format' (string 
expected, got no value)")
!   if s:lua_543_or_later
      let msg = "[string \"vim chunk\"]:1: global 'func' is not callable (a nil 
value)"
    elseif s:lua_53_or_later
      let msg = "[string \"vim chunk\"]:1: attempt to call a nil value (global 
'func')"
--- 57,63 ----
    " Error cases
    call assert_fails('luado string.format()',
          \ "[string \"vim chunk\"]:1: bad argument #1 to 'format' (string 
expected, got no value)")
!   if s:lua_543
      let msg = "[string \"vim chunk\"]:1: global 'func' is not callable (a nil 
value)"
    elseif s:lua_53_or_later
      let msg = "[string \"vim chunk\"]:1: attempt to call a nil value (global 
'func')"
***************
*** 151,157 ****
    " Window 3 does not exist so vim.window(3) should return nil
    call assert_equal('nil', luaeval('tostring(vim.window(3))'))
  
!   if s:lua_543_or_later
      let msg = "[string \"luaeval\"]:1: field 'xyz' is not callable (a nil 
value)"
    elseif s:lua_53_or_later
      let msg = "[string \"luaeval\"]:1: attempt to call a nil value (field 
'xyz')"
--- 149,155 ----
    " Window 3 does not exist so vim.window(3) should return nil
    call assert_equal('nil', luaeval('tostring(vim.window(3))'))
  
!   if s:lua_543
      let msg = "[string \"luaeval\"]:1: field 'xyz' is not callable (a nil 
value)"
    elseif s:lua_53_or_later
      let msg = "[string \"luaeval\"]:1: attempt to call a nil value (field 
'xyz')"
***************
*** 343,349 ****
    call assert_equal('4', luaeval('vim.buffer()[4]'))
    call assert_equal(v:null, luaeval('vim.buffer()[5]'))
    call assert_equal(v:null, luaeval('vim.buffer()[{}]'))
!   if s:lua_543_or_later
      let msg = "[string \"vim chunk\"]:1: method 'xyz' is not callable (a nil 
value)"
    elseif s:lua_53_or_later
      let msg = "[string \"vim chunk\"]:1: attempt to call a nil value (method 
'xyz')"
--- 341,347 ----
    call assert_equal('4', luaeval('vim.buffer()[4]'))
    call assert_equal(v:null, luaeval('vim.buffer()[5]'))
    call assert_equal(v:null, luaeval('vim.buffer()[{}]'))
!   if s:lua_543
      let msg = "[string \"vim chunk\"]:1: method 'xyz' is not callable (a nil 
value)"
    elseif s:lua_53_or_later
      let msg = "[string \"vim chunk\"]:1: attempt to call a nil value (method 
'xyz')"
***************
*** 454,460 ****
    lua ll = vim.eval('l')
    let x = luaeval("ll[3]")
    call assert_equal(v:null, x)
!   if s:lua_543_or_later
      let msg = "[string \"luaeval\"]:1: method 'xyz' is not callable (a nil 
value)"
    elseif s:lua_53_or_later
      let msg = "[string \"luaeval\"]:1: attempt to call a nil value (method 
'xyz')"
--- 452,458 ----
    lua ll = vim.eval('l')
    let x = luaeval("ll[3]")
    call assert_equal(v:null, x)
!   if s:lua_543
      let msg = "[string \"luaeval\"]:1: method 'xyz' is not callable (a nil 
value)"
    elseif s:lua_53_or_later
      let msg = "[string \"luaeval\"]:1: attempt to call a nil value (method 
'xyz')"
***************
*** 645,651 ****
    call assert_equal(2, n)
    let n = luaeval('lb[6]')
    call assert_equal(v:null, n)
!   if s:lua_543_or_later
      let msg = "[string \"luaeval\"]:1: method 'xyz' is not callable (a nil 
value)"
    elseif s:lua_53_or_later
      let msg = "[string \"luaeval\"]:1: attempt to call a nil value (method 
'xyz')"
--- 643,649 ----
    call assert_equal(2, n)
    let n = luaeval('lb[6]')
    call assert_equal(v:null, n)
!   if s:lua_543
      let msg = "[string \"luaeval\"]:1: method 'xyz' is not callable (a nil 
value)"
    elseif s:lua_53_or_later
      let msg = "[string \"luaeval\"]:1: attempt to call a nil value (method 
'xyz')"
*** ../vim-8.2.4242/src/version.c       2022-01-28 16:01:09.552028335 +0000
--- src/version.c       2022-01-28 17:19:27.039472606 +0000
***************
*** 752,753 ****
--- 752,755 ----
  {   /* Add new patch number below this line */
+ /**/
+     4243,
  /**/

-- 
SOLDIER: Where did you get the coconuts?
ARTHUR:  Through ... We found them.
SOLDIER: Found them?  In Mercea.  The coconut's tropical!
                 "Monty Python and the Holy Grail" PYTHON (MONTY) PICTURES LTD

 /// Bram Moolenaar -- [email protected] -- http://www.Moolenaar.net   \\\
///                                                                      \\\
\\\        sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ ///
 \\\            help me help AIDS victims -- http://ICCF-Holland.org    ///

-- 
-- 
You received this message from the "vim_dev" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

--- 
You received this message because you are subscribed to the Google Groups 
"vim_dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/vim_dev/20220128172037.37EF61C1908%40moolenaar.net.

Raspunde prin e-mail lui