<HTML><BODY><div>Hi!</div><div>I realized I forgot to add some refs to related issues,</div><div>so here is the new version of the commit message:</div><div>====================================================</div><div><div>test: adapt disabled tests from PUC-Rio</div><div> </div><div>Version and status are printed in stdout instead stderr<br>since LuaJIT-2.0.0-beta11 (as it is not an error message). This behavior<br>is the same as in Lua 5.2, so necessary changes in tests can be</div><div>adapted from PUC-Rio Lua 5.2 test suite.</div><div> </div><div>Closes tarantool/tarantool#5687<br>Part of tarantool/tarantool#5845<br>Part of tarantool/tarantool#4473<br>====================================================</div><div> </div><div>Best regards,</div><div>Maxim Kokryashkin</div><div> </div></div><blockquote style="border-left:1px solid #0857A6; margin:10px; padding:0 0 0 10px;"><div> <blockquote style="border-left:1px solid #0857A6; margin:10px; padding:0 0 0 10px;"><div id=""><div class="js-helper js-readmsg-msg"><div><div id="style_16324919020841021706_BODY">Version and status are printed in stdout instead stderr<br>since LuaJIT-2.0.0-beta11 (as it is not an error message). This behavior<br>is the same as in Lua 5.2, so necessary changes in tests can be<br>adapted from PUC-Rio Lua 5.2 test suite.<br><br>Closes tarantool/tarantool#5687<br>---<br>Issue: <a href="https://github.com/tarantool/tarantool/issues/5687" target="_blank">https://github.com/tarantool/tarantool/issues/5687</a><br>Branch: <a href="https://github.com/tarantool/luajit/tree/fckxorg/gh-5687-adapt-tests-output-PUC-Rio" target="_blank">https://github.com/tarantool/luajit/tree/fckxorg/gh-5687-adapt-tests-output-PUC-Rio</a><br><br> test/PUC-Rio-Lua-5.1-tests/main.lua | 53 +++++++++++++++++++----------<br> 1 file changed, 35 insertions(+), 18 deletions(-)<br><br>diff --git a/test/PUC-Rio-Lua-5.1-tests/main.lua b/test/PUC-Rio-Lua-5.1-tests/main.lua<br>index 07facc4c..34e028f5 100644<br>--- a/test/PUC-Rio-Lua-5.1-tests/main.lua<br>+++ b/test/PUC-Rio-Lua-5.1-tests/main.lua<br>@@ -24,11 +24,33 @@ local prepfile = function (s, p)<br>   assert(io.close())<br> end<br> <br>-function checkout (s)<br>+-- Taken from PUC-Rio Lua 5.2 test suite.<br>+-- See comment for checkprogout().<br>+function getoutput ()<br>   io.input(out)<br>   local t = io.read("*a")<br>   io.input():close()<br>   assert(os.remove(out))<br>+ return t<br>+end<br>+<br>+-- Version and status are printed in stdout instead stderr since<br>+-- LuaJIT-2.0.0-beta11 (as it is not an error message).<br>+-- See commit 0bd1a66f2f055211ef55834ccebca3b82d03c735<br>+-- (Print version and JIT status to stdout, not stderr.).<br>+-- This behavior is the same as in Lua 5.2.<br>+-- See also <a href="https://github.com/tarantool/tarantool/issues/5687" target="_blank">https://github.com/tarantool/tarantool/issues/5687</a>.<br>+-- This function is adapted from PUC-Rio Lua 5.2 test suite.<br>+-- It is used for test commands with -i flag.<br>+function checkprogout (s)<br>+ local t = getoutput()<br>+ for line in string.gmatch(s, ".-\n") do<br>+ assert(string.find(t, line, 1, true))<br>+ end<br>+end<br>+<br>+function checkout (s)<br>+ local t = getoutput()<br>   if s ~= t then print(string.format("'%s' - '%s'\n", s, t)) end<br>   assert(s == t)<br>   return t<br>@@ -117,37 +139,32 @@ prepfile[[<br> RUN("lua - < %s > %s", prog, out)<br> checkout("1\tnil\n")<br> <br>--- FIXME: Version and status are printed to stdout instead of<br>--- stderr since LuaJIT-2.0.0-beta11 (as it is not an error<br>--- message). See commit 0bd1a66f2f055211ef55834ccebca3b82d03c735<br>--- (Print version and JIT status to stdout, not stderr.).<br>--- This behavior is the same as in Lua 5.2.<br>--- In Lua 5.2 this feature was introduced via commit<br>--- 9e7de9473c65baee1f567852a778f2d33a47ea83.<br>--- See also <a href="https://github.com/tarantool/tarantool/issues/5687" target="_blank">https://github.com/tarantool/tarantool/issues/5687</a>.<br>+-- Test is adapted from PUC-Rio Lua 5.2 test suite.<br>+-- See comment for checkprogout().<br> prepfile[[<br> = (6*2-6) -- ===<br> a<br> = 10<br> print(a)<br> = a]]<br>--- FIXME: Behavior is different for LuaJIT. See the comment above.<br>--- RUN([[lua -e"_PROMPT='' _PROMPT2=''" -i < %s > %s]], prog, out)<br>--- checkout("6\n10\n10\n\n")<br>+RUN([[lua -e"_PROMPT='' _PROMPT2=''" -i < %s > %s]], prog, out)<br>+checkprogout("6\n10\n10\n\n")<br> <br>+-- Test is adapted from PUC-Rio Lua 5.2 test suite.<br>+-- See comment for checkprogout().<br> prepfile("a = [[b\nc\nd\ne]]\n=a")<br> print(prog)<br>--- FIXME: Behavior is different for LuaJIT. See the comment above.<br>--- RUN([[lua -e"_PROMPT='' _PROMPT2=''" -i < %s > %s]], prog, out)<br>--- checkout("b\nc\nd\ne\n\n")<br>+RUN([[lua -e"_PROMPT='' _PROMPT2=''" -i < %s > %s]], prog, out)<br>+checkprogout("b\nc\nd\ne\n\n")<br> <br>+-- Test is adapted from PUC-Rio Lua 5.2 test suite.<br>+-- See comment for checkprogout().<br> prompt = "alo"<br> prepfile[[ --<br> a = 2<br> ]]<br>--- FIXME: Behavior is different for LuaJIT. See the comment above.<br>--- RUN([[lua "-e_PROMPT='%s'" -i < %s > %s]], prompt, prog, out)<br>--- checkout(string.rep(prompt, 3).."\n")<br>+RUN([[lua "-e_PROMPT='%s'" -i < %s > %s]], prompt, prog, out)<br>+checkprogout(string.rep(prompt, 3).."\n")<br> <br> s = [=[ --<br> function f ( x )<br>--<br>2.33.0</div></div></div></div></blockquote><div> </div></div></blockquote></BODY></HTML>