]> granicus.if.org Git - vim/commitdiff
patch 8.2.4243: Lua tests fail with Lua 5.4.4 v8.2.4243
author=?UTF-8?q?Jakub=20Kul=C3=ADk?= <kulikjak@gmail.com>
Fri, 28 Jan 2022 17:20:03 +0000 (17:20 +0000)
committerBram Moolenaar <Bram@vim.org>
Fri, 28 Jan 2022 17:20:03 +0000 (17:20 +0000)
Problem:    Lua tests fail with Lua 5.4.4.
Solution:   Check messages like before Lua 5.4.3. (Jakub KulĂ­k, closes #9652)

src/testdir/test_lua.vim
src/version.c

index dd493fe79ab8bf4b388e5b3c546fde1717329e64..fd265ef431edb5f7e1300afeaa9b67a3b3f7b48b 100644 (file)
@@ -15,13 +15,11 @@ CheckFeature float
 " 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
+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) || s:minor > 4))
-        \ || s:major > 5
-    let s:lua_543_or_later = 1
+  if s:major == 5 && s:minor == 4 && s:patch == 3
+    let s:lua_543 = 1
   endif
 endif
 
@@ -59,7 +57,7 @@ func Test_lua_luado()
   " 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
+  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,7 +149,7 @@ func Test_lua_window()
   " 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
+  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,7 +341,7 @@ func Test_lua_buffer_insert()
   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
+  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,7 +452,7 @@ func Test_lua_list()
   lua ll = vim.eval('l')
   let x = luaeval("ll[3]")
   call assert_equal(v:null, x)
-  if s:lua_543_or_later
+  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,7 +643,7 @@ func Test_lua_blob()
   call assert_equal(2, n)
   let n = luaeval('lb[6]')
   call assert_equal(v:null, n)
-  if s:lua_543_or_later
+  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')"
index 882fb0bf242a030f7abe24f3494af09f838f59c2..400f5787f95e8125d8b1ca91376985817ede4505 100644 (file)
@@ -750,6 +750,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    4243,
 /**/
     4242,
 /**/