Script 'mail_helper' called by obssrc Hello community, here is the log from the commit of package lua54 for openSUSE:Factory checked in at 2022-02-05 23:22:58 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/lua54 (Old) and /work/SRC/openSUSE:Factory/.lua54.new.1898 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "lua54" Sat Feb 5 23:22:58 2022 rev:15 rq:949765 version:5.4.4 Changes: -------- --- /work/SRC/openSUSE:Factory/lua54/lua54.changes 2022-01-03 10:49:07.819573805 +0100 +++ /work/SRC/openSUSE:Factory/.lua54.new.1898/lua54.changes 2022-02-05 23:23:07.683947319 +0100 @@ -1,0 +2,13 @@ +Wed Jan 26 19:15:13 UTC 2022 - Callum Farmer <gm...@opensuse.org> + +- Ensure shared library is installed with executable bit set + +------------------------------------------------------------------- +Wed Jan 26 18:35:13 UTC 2022 - Callum Farmer <gm...@opensuse.org> + +- Update to Lua 5.4.4: + * fixes all bugs found in Lua 5.4.3 +- Removed upstream-bugs.patch: new release (no bugs found yet) +- Removed upstream-bugs-test.patch: new release (no bugs found yet) + +------------------------------------------------------------------- Old: ---- lua-5.4.3-tests.tar.gz lua-5.4.3.tar.gz upstream-bugs-test.patch upstream-bugs.patch New: ---- lua-5.4.4-tests.tar.gz lua-5.4.4.tar.gz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ lua54.spec ++++++ --- /var/tmp/diff_new_pack.BcONhA/_old 2022-02-05 23:23:08.371942614 +0100 +++ /var/tmp/diff_new_pack.BcONhA/_new 2022-02-05 23:23:08.375942587 +0100 @@ -26,7 +26,7 @@ %define libname liblua5_4-5 %define lua_docdir %{_datadir}/doc/lua%{major_version} Name: lua54%{name_ext} -Version: 5.4.3 +Version: 5.4.4 Release: 0 Summary: Small Embeddable Language with Procedural Syntax License: GPL-3.0-or-later @@ -42,9 +42,6 @@ Patch1: attrib_test.patch Patch2: files_test.patch Patch3: main_test.patch -# PATCH-FIX-UPSTREAM https://www.lua.org/bugs.html#5.4.3 -Patch4: upstream-bugs.patch -Patch5: upstream-bugs-test.patch Patch6: shared_link.patch %if "%{flavor}" == "test" BuildRequires: lua54 @@ -145,11 +142,9 @@ %patch1 -p1 %patch2 -p1 %patch3 -p1 -%patch5 -p1 %else %setup -q -n lua-%{version} %patch0 -p1 -%patch4 -p1 %patch6 -p1 %endif ++++++ lua-5.4.3-tests.tar.gz -> lua-5.4.4-tests.tar.gz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/lua-5.4.3-tests/api.lua new/lua-5.4.4-tests/api.lua --- old/lua-5.4.3-tests/api.lua 2021-03-15 14:32:52.000000000 +0100 +++ new/lua-5.4.4-tests/api.lua 2022-01-13 12:24:44.000000000 +0100 @@ -804,15 +804,14 @@ d = nil assert(debug.getmetatable(x).__gc == F) assert(load("table.insert({}, {})"))() -- create more garbage - collectgarbage() -- force a GC during GC - assert(debug.getmetatable(x).__gc == F) -- previous GC did not mess this? + assert(not collectgarbage()) -- GC during GC (no op) local dummy = {} -- create more garbage during GC if A ~= nil then assert(type(A) == "userdata") assert(T.udataval(A) == B) debug.getmetatable(A) -- just access it end - A = x -- ressucita userdata + A = x -- ressurect userdata B = udval return 1,2,3 end diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/lua-5.4.3-tests/bitwise.lua new/lua-5.4.4-tests/bitwise.lua --- old/lua-5.4.3-tests/bitwise.lua 2021-03-15 14:32:52.000000000 +0100 +++ new/lua-5.4.4-tests/bitwise.lua 2022-01-13 12:24:44.000000000 +0100 @@ -45,6 +45,11 @@ -1 << numbits == 0 and -1 << -numbits == 0) +assert(1 >> math.mininteger == 0) +assert(1 >> math.maxinteger == 0) +assert(1 << math.mininteger == 0) +assert(1 << math.maxinteger == 0) + assert((2^30 - 1) << 2^30 == 0) assert((2^30 - 1) >> 2^30 == 0) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/lua-5.4.3-tests/code.lua new/lua-5.4.4-tests/code.lua --- old/lua-5.4.3-tests/code.lua 2021-03-15 14:32:53.000000000 +0100 +++ new/lua-5.4.4-tests/code.lua 2022-01-13 12:24:44.000000000 +0100 @@ -69,6 +69,20 @@ checkKlist(foo, {100000, 100000.0, -100000, -100000.0}) +-- floats x integers +foo = function (t, a) + t[a] = 1; t[a] = 1.0 + t[a] = 1; t[a] = 1.0 + t[a] = 2; t[a] = 2.0 + t[a] = 0; t[a] = 0.0 + t[a] = 1; t[a] = 1.0 + t[a] = 2; t[a] = 2.0 + t[a] = 0; t[a] = 0.0 +end + +checkKlist(foo, {1, 1.0, 2, 2.0, 0, 0.0}) + + -- testing opcodes -- check that 'f' opcodes match '...' diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/lua-5.4.3-tests/coroutine.lua new/lua-5.4.4-tests/coroutine.lua --- old/lua-5.4.3-tests/coroutine.lua 2021-03-15 14:32:53.000000000 +0100 +++ new/lua-5.4.4-tests/coroutine.lua 2022-01-13 12:24:44.000000000 +0100 @@ -136,6 +136,10 @@ assert(coroutine.status(co) == "dead") local st, msg = coroutine.close(co) assert(st and msg == nil) + -- also ok to close it again + st, msg = coroutine.close(co) + assert(st and msg == nil) + -- cannot close the running coroutine local st, msg = pcall(coroutine.close, coroutine.running()) @@ -149,6 +153,22 @@ assert(not st and string.find(msg, "normal")) end))() + -- cannot close a coroutine while closing it + do + local co + co = coroutine.create( + function() + local x <close> = func2close(function() + coroutine.close(co) -- try to close it again + end) + coroutine.yield(20) + end) + local st, msg = coroutine.resume(co) + assert(st and msg == 20) + st, msg = coroutine.close(co) + assert(not st and string.find(msg, "running coroutine")) + end + -- to-be-closed variables in coroutines local X @@ -158,6 +178,9 @@ assert(not st and msg == 100) st, msg = coroutine.close(co) assert(not st and msg == 100) + -- after closing, no more errors + st, msg = coroutine.close(co) + assert(st and msg == nil) co = coroutine.create(function () local x <close> = func2close(function (self, err) @@ -189,6 +212,9 @@ local st, msg = coroutine.close(co) assert(st == false and coroutine.status(co) == "dead" and msg == 200) assert(x == 200) + -- after closing, no more errors + st, msg = coroutine.close(co) + assert(st and msg == nil) end do @@ -205,7 +231,7 @@ co = coroutine.create(function () return pcall(foo) end) local st1, st2, err = coroutine.resume(co) assert(st1 and not st2 and err == 43) - assert(X == 43 and Y.name == "pcall") + assert(X == 43 and Y.what == "C") -- recovering from errors in __close metamethods local track = {} @@ -419,7 +445,7 @@ local X = false A = coroutine.wrap(function() - local _ <close> = setmetatable({}, {__close = function () X = true end}) + local _ <close> = func2close(function () X = true end) return pcall(A, 1) end) st, res = A() @@ -427,6 +453,22 @@ end +-- bug in 5.4.1 +do + -- coroutine ran close metamethods with invalid status during a + -- reset. + local co + co = coroutine.wrap(function() + local x <close> = func2close(function() return pcall(co) end) + error(111) + end) + local st, errobj = pcall(co) + assert(not st and errobj == 111) + st, errobj = pcall(co) + assert(not st and string.find(errobj, "dead coroutine")) +end + + -- attempt to resume 'normal' coroutine local co1, co2 co1 = coroutine.create(function () return co2() end) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/lua-5.4.3-tests/cstack.lua new/lua-5.4.4-tests/cstack.lua --- old/lua-5.4.3-tests/cstack.lua 2021-03-15 14:32:53.000000000 +0100 +++ new/lua-5.4.4-tests/cstack.lua 2022-01-13 12:24:44.000000000 +0100 @@ -103,6 +103,20 @@ end +do -- bug in 5.4.2 + print("nesting coroutines running after recoverable errors") + local count = 0 + local function foo() + count = count + 1 + pcall(1) -- create an error + -- running now inside 'precover' ("protected recover") + coroutine.wrap(foo)() -- call another coroutine + end + checkerror("C stack overflow", foo) + print("final count: ", count) +end + + if T then print("testing stack recovery") local N = 0 -- trace number of calls diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/lua-5.4.3-tests/db.lua new/lua-5.4.4-tests/db.lua --- old/lua-5.4.3-tests/db.lua 2021-03-15 14:32:53.000000000 +0100 +++ new/lua-5.4.4-tests/db.lua 2022-01-13 12:24:44.000000000 +0100 @@ -195,6 +195,49 @@ end end + +do -- testing active lines + local function checkactivelines (f, lines) + local t = debug.getinfo(f, "SL") + for _, l in pairs(lines) do + l = l + t.linedefined + assert(t.activelines[l]) + t.activelines[l] = undef + end + assert(next(t.activelines) == nil) -- no extra lines + end + + checkactivelines(function (...) -- vararg function + -- 1st line is empty + -- 2nd line is empty + -- 3th line is empty + local a = 20 + -- 5th line is empty + local b = 30 + -- 7th line is empty + end, {4, 6, 8}) + + checkactivelines(function (a) + -- 1st line is empty + -- 2nd line is empty + local a = 20 + local b = 30 + -- 5th line is empty + end, {3, 4, 6}) + + checkactivelines(function (a, b, ...) end, {0}) + + checkactivelines(function (a, b) + end, {1}) + + for _, n in pairs{0, 1, 2, 10, 50, 100, 1000, 10000} do + checkactivelines( + load(string.format("%s return 1", string.rep("\n", n))), + {n + 1}) + end + +end + print'+' -- invalid levels in [gs]etlocal @@ -844,7 +887,7 @@ -- create a piece of garbage with a finalizer setmetatable({}, {__gc = function () - local t = debug.getinfo(2) -- get callee information + local t = debug.getinfo(1) -- get function information assert(t.namewhat == "metamethod") name = t.name end}) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/lua-5.4.3-tests/errors.lua new/lua-5.4.4-tests/errors.lua --- old/lua-5.4.3-tests/errors.lua 2021-03-15 14:32:53.000000000 +0100 +++ new/lua-5.4.4-tests/errors.lua 2022-01-13 12:24:44.000000000 +0100 @@ -26,7 +26,7 @@ local function checkmessage (prog, msg, debug) local m = doit(prog) - if debug then print(m) end + if debug then print(m, msg) end assert(string.find(m, msg, 1, true)) end @@ -228,6 +228,22 @@ checkmessage("return {} < XX", "table with My Type") checkmessage("return XX < io.stdin", "My Type with FILE*") _G.XX = nil + + if T then -- extra tests for 'luaL_tolstring' + -- bug in 5.4.3; 'luaL_tolstring' with negative indices + local x = setmetatable({}, {__name="TABLE"}) + assert(T.testC("Ltolstring -1; return 1", x) == tostring(x)) + + local a, b = T.testC("pushint 10; Ltolstring -2; return 2", x) + assert(a == 10 and b == tostring(x)) + + setmetatable(x, {__tostring=function (o) + assert(o == x) + return "ABC" + end}) + local a, b, c = T.testC("pushint 10; Ltolstring -2; return 3", x) + assert(a == x and b == 10 and c == "ABC") + end end -- global functions @@ -289,7 +305,7 @@ checkmessage([[ -- tail call return math.sin("a") -]], "'sin'") +]], "sin") checkmessage([[collectgarbage("nooption")]], "invalid option") diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/lua-5.4.3-tests/gc.lua new/lua-5.4.4-tests/gc.lua --- old/lua-5.4.3-tests/gc.lua 2021-03-15 14:32:53.000000000 +0100 +++ new/lua-5.4.4-tests/gc.lua 2022-01-13 12:24:44.000000000 +0100 @@ -371,7 +371,7 @@ warn("@on"); warn("@store") collectgarbage() - assert(string.find(_WARN, "error in __gc metamethod")) + assert(string.find(_WARN, "error in __gc")) assert(string.match(_WARN, "@(.-)@") == "expected"); _WARN = false for i = 8, 10 do assert(s[i]) end @@ -676,11 +676,13 @@ -- just to make sure assert(collectgarbage'isrunning') -do -- check that the collector is reentrant in incremental mode +do -- check that the collector is not reentrant in incremental mode + local res = true setmetatable({}, {__gc = function () - collectgarbage() + res = collectgarbage() end}) collectgarbage() + assert(not res) end diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/lua-5.4.3-tests/literals.lua new/lua-5.4.4-tests/literals.lua --- old/lua-5.4.3-tests/literals.lua 2021-03-15 14:32:53.000000000 +0100 +++ new/lua-5.4.4-tests/literals.lua 2022-01-13 12:24:45.000000000 +0100 @@ -208,6 +208,30 @@ b = nil +do -- reuse of long strings + + -- get the address of a string + local function getadd (s) return string.format("%p", s) end + + local s1 <const> = "01234567890123456789012345678901234567890123456789" + local s2 <const> = "01234567890123456789012345678901234567890123456789" + local s3 = "01234567890123456789012345678901234567890123456789" + local function foo() return s1 end + local function foo1() return s3 end + local function foo2() + return "01234567890123456789012345678901234567890123456789" + end + local a1 = getadd(s1) + assert(a1 == getadd(s2)) + assert(a1 == getadd(foo())) + assert(a1 == getadd(foo1())) + assert(a1 == getadd(foo2())) + + local sd = "0123456789" .. "0123456789012345678901234567890123456789" + assert(sd == s1 and getadd(sd) ~= a1) +end + + -- testing line ends prog = [[ a = 1 -- a comment diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/lua-5.4.3-tests/locals.lua new/lua-5.4.4-tests/locals.lua --- old/lua-5.4.3-tests/locals.lua 2021-03-15 14:32:53.000000000 +0100 +++ new/lua-5.4.4-tests/locals.lua 2022-01-13 12:24:45.000000000 +0100 @@ -187,6 +187,8 @@ checkro("y", "local x, y <const>, z = 10, 20, 30; x = 11; y = 12") checkro("x", "local x <const>, y, z <const> = 10, 20, 30; x = 11") checkro("z", "local x <const>, y, z <const> = 10, 20, 30; y = 10; z = 11") + checkro("foo", "local foo <const> = 10; function foo() end") + checkro("foo", "local foo <const> = {}; function foo() end") checkro("z", [[ local a, z <const>, b = 10; @@ -335,6 +337,29 @@ end +do + -- bug in 5.4.3: previous condition (calls cannot be tail in the + -- scope of to-be-closed variables) must be valid for tbc variables + -- created by 'for' loops. + + local closed = false + + local function foo () + return function () return true end, 0, 0, + func2close(function () closed = true end) + end + + local function tail() return closed end + + local function foo1 () + for k in foo() do return tail() end + end + + assert(foo1() == false) + assert(closed == true) +end + + do print("testing errors in __close") -- original error is in __close @@ -791,6 +816,65 @@ do + -- yielding inside closing metamethods while returning + -- (bug in 5.4.3) + + local extrares -- result from extra yield (if any) + + local function check (body, extra, ...) + local t = table.pack(...) -- expected returns + local co = coroutine.wrap(body) + if extra then + extrares = co() -- runs until first (extra) yield + end + local res = table.pack(co()) -- runs until yield inside '__close' + assert(res.n == 2 and res[2] == nil) + local res2 = table.pack(co()) -- runs until end of function + assert(res2.n == t.n) + for i = 1, #t do + if t[i] == "x" then + assert(res2[i] == res[1]) -- value that was closed + else + assert(res2[i] == t[i]) + end + end + end + + local function foo () + local x <close> = func2close(coroutine.yield) + local extra <close> = func2close(function (self) + assert(self == extrares) + coroutine.yield(100) + end) + extrares = extra + return table.unpack{10, x, 30} + end + check(foo, true, 10, "x", 30) + assert(extrares == 100) + + local function foo () + local x <close> = func2close(coroutine.yield) + return + end + check(foo, false) + + local function foo () + local x <close> = func2close(coroutine.yield) + local y, z = 20, 30 + return x + end + check(foo, false, "x") + + local function foo () + local x <close> = func2close(coroutine.yield) + local extra <close> = func2close(coroutine.yield) + return table.unpack({}, 1, 100) -- 100 nils + end + check(foo, true, table.unpack({}, 1, 100)) + +end + +do -- yielding inside closing metamethods after an error local co = coroutine.wrap(function () diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/lua-5.4.3-tests/ltests/ltests.c new/lua-5.4.4-tests/ltests/ltests.c --- old/lua-5.4.3-tests/ltests/ltests.c 2021-03-15 14:32:51.000000000 +0100 +++ new/lua-5.4.4-tests/ltests/ltests.c 2022-01-13 12:24:42.000000000 +0100 @@ -1743,6 +1743,9 @@ (void)s1; /* to avoid warnings */ lua_longassert((s == NULL && s1 == NULL) || strcmp(s, s1) == 0); } + else if EQ("Ltolstring") { + luaL_tolstring(L1, getindex, NULL); + } else if EQ("type") { lua_pushstring(L1, luaL_typename(L1, getnum)); } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/lua-5.4.3-tests/main.lua new/lua-5.4.4-tests/main.lua --- old/lua-5.4.3-tests/main.lua 2021-03-15 14:32:53.000000000 +0100 +++ new/lua-5.4.4-tests/main.lua 2022-01-13 12:24:45.000000000 +0100 @@ -190,6 +190,11 @@ RUN('env LUA_PATH="?;;" lua -l %s -l%s -lstring -l io %s > %s', prog, otherprog, otherprog, out) checkout("1\n2\n15\n2\n15\n") +-- test explicit global names in -l +prepfile("print(str.upper'alo alo', m.max(10, 20))") +RUN("lua -l 'str=string' '-lm=math' -e 'print(m.sin(0))' %s > %s", prog, out) +checkout("0.0\nALO ALO\t20\n") + -- test 'arg' table local a = [[ assert(#arg == 3 and arg[1] == 'a' and @@ -256,6 +261,34 @@ RUN('lua -W %s 2> %s', prog, out) checkprogout("ZYX)\nXYZ)\n") +-- bug since 5.2: finalizer called when closing a state could +-- subvert finalization order +prepfile[[ +-- should be called last +print("creating 1") +setmetatable({}, {__gc = function () print(1) end}) + +print("creating 2") +setmetatable({}, {__gc = function () + print("2") + print("creating 3") + -- this finalizer should not be called, as object will be + -- created after 'lua_close' has been called + setmetatable({}, {__gc = function () print(3) end}) + print(collectgarbage()) -- cannot call collector here + os.exit(0, true) +end}) +]] +RUN('lua -W %s > %s', prog, out) +checkout[[ +creating 1 +creating 2 +2 +creating 3 +nil +1 +]] + -- test many arguments prepfile[[print(({...})[30])]] diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/lua-5.4.3-tests/math.lua new/lua-5.4.4-tests/math.lua --- old/lua-5.4.3-tests/math.lua 2021-03-15 14:32:53.000000000 +0100 +++ new/lua-5.4.4-tests/math.lua 2022-01-13 12:24:45.000000000 +0100 @@ -849,6 +849,7 @@ math.randomseed(x, y) -- again should repeat the state assert(math.random(0) == res) -- keep the random seed for following tests + print(string.format("random seeds: %d, %d", x, y)) end do -- test random for floats diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/lua-5.4.3-tests/nextvar.lua new/lua-5.4.4-tests/nextvar.lua --- old/lua-5.4.3-tests/nextvar.lua 2021-03-15 14:32:53.000000000 +0100 +++ new/lua-5.4.4-tests/nextvar.lua 2022-01-13 12:24:45.000000000 +0100 @@ -43,6 +43,14 @@ assert(type(ipairs{}) == 'function' and ipairs{} == ipairs{}) +do -- overflow (must wrap-around) + local f = ipairs{} + local k, v = f({[math.mininteger] = 10}, math.maxinteger) + assert(k == math.mininteger and v == 10) + k, v = f({[math.mininteger] = 10}, k) + assert(k == nil) +end + if not T then (Message or print) ('\n >>> testC not active: skipping tests for table sizes <<<\n') @@ -499,6 +507,15 @@ end +do -- testing overflow in table.insert (must wrap-around) + + local t = setmetatable({}, + {__len = function () return math.maxinteger end}) + table.insert(t, 20) + local k, v = next(t) + assert(k == math.mininteger and v == 20) +end + if not T then (Message or print) ('\n >>> testC not active: skipping tests for table library on non-tables <<<\n') @@ -764,4 +781,25 @@ end assert(i == a.n) + +-- testing yield inside __pairs +do + local t = setmetatable({10, 20, 30}, {__pairs = function (t) + local inc = coroutine.yield() + return function (t, i) + if i > 1 then return i - inc, t[i - inc] else return nil end + end, t, #t + 1 + end}) + + local res = {} + local co = coroutine.wrap(function () + for i,p in pairs(t) do res[#res + 1] = p end + end) + + co() -- start coroutine + co(1) -- continue after yield + assert(res[1] == 30 and res[2] == 20 and res[3] == 10 and #res == 3) + +end + print"OK" diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/lua-5.4.3-tests/strings.lua new/lua-5.4.4-tests/strings.lua --- old/lua-5.4.3-tests/strings.lua 2021-03-15 14:32:54.000000000 +0100 +++ new/lua-5.4.4-tests/strings.lua 2022-01-13 12:24:45.000000000 +0100 @@ -202,13 +202,11 @@ "\0\xe4\0b8c\0") assert(string.format('') == "") assert(string.format("%c",34)..string.format("%c",48)..string.format("%c",90)..string.format("%c",100) == - string.format("%c%c%c%c", 34, 48, 90, 100)) + string.format("%1c%-c%-1c%c", 34, 48, 90, 100)) assert(string.format("%s\0 is not \0%s", 'not be', 'be') == 'not be\0 is not \0be') assert(string.format("%%%d %010d", 10, 23) == "%10 0000000023") assert(tonumber(string.format("%f", 10.3)) == 10.3) -x = string.format('"%-50s"', 'a') -assert(#x == 52) -assert(string.sub(x, 1, 4) == '"a ') +assert(string.format('"%-50s"', 'a') == '"a' .. string.rep(' ', 49) .. '"') assert(string.format("-%.20s.20s", string.rep("%", 2000)) == "-"..string.rep("%", 20)..".20s") @@ -237,7 +235,6 @@ assert(string.format("\0%s\0", "\0\0\1") == "\0\0\0\1\0") checkerror("contains zeros", string.format, "%10s", "\0") -checkerror("cannot have modifiers", string.format, "%10q", "1") -- format x tostring assert(string.format("%s %s", nil, true) == "nil true") @@ -341,6 +338,21 @@ end +-- testing some flags (all these results are required by ISO C) +assert(string.format("%#12o", 10) == " 012") +assert(string.format("%#10x", 100) == " 0x64") +assert(string.format("%#-17X", 100) == "0X64 ") +assert(string.format("%013i", -100) == "-000000000100") +assert(string.format("%2.5d", -100) == "-00100") +assert(string.format("%.u", 0) == "") +assert(string.format("%+#014.0f", 100) == "+000000000100.") +assert(string.format("% 1.0E", 100) == " 1E+02") +assert(string.format("%-16c", 97) == "a ") +assert(string.format("%+.3G", 1.5) == "+1.5") +assert(string.format("% .1g", 2^10) == " 1e+03") +assert(string.format("%.0s", "alo") == "") +assert(string.format("%.s", "alo") == "") + -- errors in format local function check (fmt, msg) @@ -348,13 +360,21 @@ end local aux = string.rep('0', 600) -check("%100.3d", "too long") +check("%100.3d", "invalid conversion") check("%1"..aux..".3d", "too long") -check("%1.100d", "too long") +check("%1.100d", "invalid conversion") check("%10.1"..aux.."004d", "too long") check("%t", "invalid conversion") -check("%"..aux.."d", "repeated flags") +check("%"..aux.."d", "too long") check("%d %d", "no value") +check("%010c", "invalid conversion") +check("%.10c", "invalid conversion") +check("%0.34s", "invalid conversion") +check("%#i", "invalid conversion") +check("%3.1p", "invalid conversion") +check("%0.s", "invalid conversion") +check("%10q", "cannot have modifiers") +check("%F", "invalid conversion") -- useless and not in C89 assert(load("return 1\n--comment without ending EOL")() == 1) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/lua-5.4.3-tests/utf8.lua new/lua-5.4.4-tests/utf8.lua --- old/lua-5.4.3-tests/utf8.lua 2021-03-15 14:32:54.000000000 +0100 +++ new/lua-5.4.4-tests/utf8.lua 2022-01-13 12:24:45.000000000 +0100 @@ -112,6 +112,12 @@ end errorcodes("ab\xff") errorcodes("\u{110000}") + + -- calling interation function with invalid arguments + local f = utf8.codes("") + assert(f("", 2) == nil) + assert(f("", -1) == nil) + assert(f("", math.mininteger) == nil) end -- error in initial position for offset ++++++ lua-5.4.3-tests.tar.gz -> lua-5.4.4.tar.gz ++++++ ++++ 62076 lines of diff (skipped) ++++++ lua-build-system.patch ++++++ --- /var/tmp/diff_new_pack.BcONhA/_old 2022-02-05 23:23:08.575941219 +0100 +++ /var/tmp/diff_new_pack.BcONhA/_new 2022-02-05 23:23:08.579941191 +0100 @@ -4,7 +4,7 @@ --- a/Makefile +++ b/Makefile -@@ -10,19 +12,20 @@ +@@ -10,19 +12,19 @@ # so take care if INSTALL_TOP is not an absolute path. See the local target. # You may want to make INSTALL_LMOD and INSTALL_CMOD consistent with # LUA_ROOT, LUA_LDIR, and LUA_CDIR in luaconf.h. @@ -27,7 +27,6 @@ -INSTALL_EXEC= $(INSTALL) -m 0755 +INSTALL_EXEC= $(LIBTOOL) --mode=install install -m 0755 INSTALL_DATA= $(INSTALL) -m 0644 -+INSTALL_LIBTOOL= $(LIBTOOL) --mode=install install -m 0644 # # If you don't have "install" you can use "cp" instead. # INSTALL= cp -p @@ -54,7 +53,7 @@ install: dummy cd src && $(MKDIR) $(INSTALL_BIN) $(INSTALL_INC) $(INSTALL_LIB) $(INSTALL_MAN) $(INSTALL_LMOD) $(INSTALL_CMOD) -+ cd src && $(INSTALL_LIBTOOL) $(TO_LIB) $(INSTALL_LIB) ++ cd src && $(INSTALL_EXEC) $(TO_LIB) $(INSTALL_LIB) cd src && $(INSTALL_EXEC) $(TO_BIN) $(INSTALL_BIN) cd src && $(INSTALL_DATA) $(TO_INC) $(INSTALL_INC) - cd src && $(INSTALL_DATA) $(TO_LIB) $(INSTALL_LIB) ++++++ shared_link.patch ++++++ --- /var/tmp/diff_new_pack.BcONhA/_old 2022-02-05 23:23:08.595941082 +0100 +++ /var/tmp/diff_new_pack.BcONhA/_new 2022-02-05 23:23:08.599941055 +0100 @@ -20,4 +20,15 @@ void* data, int strip); #endif +--- a/src/lmem.h ++++ b/src/lmem.h +@@ -81,7 +81,7 @@ + size_t size); + LUAI_FUNC void *luaM_saferealloc_ (lua_State *L, void *block, size_t oldsize, + size_t size); +-LUAI_FUNC void luaM_free_ (lua_State *L, void *block, size_t osize); ++LUA_API void luaM_free_ (lua_State *L, void *block, size_t osize); + LUAI_FUNC void *luaM_growaux_ (lua_State *L, void *block, int nelems, + int *size, int size_elem, int limit, + const char *what);