Tarantool development patches archive
 help / color / mirror / Atom feed
* [Tarantool-patches] [PATCH luajit] test: adapt disabled tests from PUC-Rio
@ 2021-09-24 13:58 Maxim Kokryashkin via Tarantool-patches
  2021-09-24 14:34 ` Максим Корякшин via Tarantool-patches
                   ` (2 more replies)
  0 siblings, 3 replies; 12+ messages in thread
From: Maxim Kokryashkin via Tarantool-patches @ 2021-09-24 13:58 UTC (permalink / raw)
  To: tarantool-patches, imun, skaplun

Version and status are printed in stdout instead stderr
since LuaJIT-2.0.0-beta11 (as it is not an error message). This behavior
is the same as in Lua 5.2, so necessary changes in tests can be
adapted from PUC-Rio Lua 5.2 test suite.

Closes tarantool/tarantool#5687
---
Issue: https://github.com/tarantool/tarantool/issues/5687
Branch: https://github.com/tarantool/luajit/tree/fckxorg/gh-5687-adapt-tests-output-PUC-Rio

 test/PUC-Rio-Lua-5.1-tests/main.lua | 53 +++++++++++++++++++----------
 1 file changed, 35 insertions(+), 18 deletions(-)

diff --git a/test/PUC-Rio-Lua-5.1-tests/main.lua b/test/PUC-Rio-Lua-5.1-tests/main.lua
index 07facc4c..34e028f5 100644
--- a/test/PUC-Rio-Lua-5.1-tests/main.lua
+++ b/test/PUC-Rio-Lua-5.1-tests/main.lua
@@ -24,11 +24,33 @@ local prepfile = function (s, p)
   assert(io.close())
 end
 
-function checkout (s)
+-- Taken from PUC-Rio Lua 5.2 test suite.
+-- See comment for checkprogout().
+function getoutput ()
   io.input(out)
   local t = io.read("*a")
   io.input():close()
   assert(os.remove(out))
+  return t
+end
+
+-- Version and status are printed in stdout instead stderr since
+-- LuaJIT-2.0.0-beta11 (as it is not an error message).
+-- See commit 0bd1a66f2f055211ef55834ccebca3b82d03c735
+-- (Print version and JIT status to stdout, not stderr.).
+-- This behavior is the same as in Lua 5.2.
+-- See also https://github.com/tarantool/tarantool/issues/5687.
+-- This function is adapted from PUC-Rio Lua 5.2 test suite.
+-- It is used for test commands with -i flag.
+function checkprogout (s)
+  local t = getoutput()
+  for line in string.gmatch(s, ".-\n") do
+    assert(string.find(t, line, 1, true))
+  end
+end
+
+function checkout (s)
+  local t = getoutput()
   if s ~= t then print(string.format("'%s' - '%s'\n", s, t)) end
   assert(s == t)
   return t
@@ -117,37 +139,32 @@ prepfile[[
 RUN("lua - < %s > %s", prog, out)
 checkout("1\tnil\n")
 
--- FIXME: Version and status are printed to stdout instead of
--- stderr since LuaJIT-2.0.0-beta11 (as it is not an error
--- message). See commit 0bd1a66f2f055211ef55834ccebca3b82d03c735
--- (Print version and JIT status to stdout, not stderr.).
--- This behavior is the same as in Lua 5.2.
--- In Lua 5.2 this feature was introduced via commit
--- 9e7de9473c65baee1f567852a778f2d33a47ea83.
--- See also https://github.com/tarantool/tarantool/issues/5687.
+-- Test is adapted from PUC-Rio Lua 5.2 test suite.
+-- See comment for checkprogout().
 prepfile[[
 = (6*2-6) -- ===
 a
 = 10
 print(a)
 = a]]
--- FIXME: Behavior is different for LuaJIT. See the comment above.
--- RUN([[lua -e"_PROMPT='' _PROMPT2=''" -i < %s > %s]], prog, out)
--- checkout("6\n10\n10\n\n")
+RUN([[lua -e"_PROMPT='' _PROMPT2=''" -i < %s > %s]], prog, out)
+checkprogout("6\n10\n10\n\n")
 
+-- Test is adapted from PUC-Rio Lua 5.2 test suite.
+-- See comment for checkprogout().
 prepfile("a = [[b\nc\nd\ne]]\n=a")
 print(prog)
--- FIXME: Behavior is different for LuaJIT. See the comment above.
--- RUN([[lua -e"_PROMPT='' _PROMPT2=''" -i < %s > %s]], prog, out)
--- checkout("b\nc\nd\ne\n\n")
+RUN([[lua -e"_PROMPT='' _PROMPT2=''" -i < %s > %s]], prog, out)
+checkprogout("b\nc\nd\ne\n\n")
 
+-- Test is adapted from PUC-Rio Lua 5.2 test suite.
+-- See comment for checkprogout().
 prompt = "alo"
 prepfile[[ --
 a = 2
 ]]
--- FIXME: Behavior is different for LuaJIT. See the comment above.
--- RUN([[lua "-e_PROMPT='%s'" -i < %s > %s]], prompt, prog, out)
--- checkout(string.rep(prompt, 3).."\n")
+RUN([[lua "-e_PROMPT='%s'" -i < %s > %s]], prompt, prog, out)
+checkprogout(string.rep(prompt, 3).."\n")
 
 s = [=[ --
 function f ( x )
-- 
2.33.0


^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [Tarantool-patches]  [PATCH luajit] test: adapt disabled tests from PUC-Rio
  2021-09-24 13:58 [Tarantool-patches] [PATCH luajit] test: adapt disabled tests from PUC-Rio Maxim Kokryashkin via Tarantool-patches
@ 2021-09-24 14:34 ` Максим Корякшин via Tarantool-patches
  2021-10-08  8:58   ` Sergey Kaplun via Tarantool-patches
  2021-10-08  8:54 ` [Tarantool-patches] [PATCH luajit] " Sergey Kaplun via Tarantool-patches
  2022-02-17 16:38 ` Igor Munkin via Tarantool-patches
  2 siblings, 1 reply; 12+ messages in thread
From: Максим Корякшин via Tarantool-patches @ 2021-09-24 14:34 UTC (permalink / raw)
  To: Maxim Kokryashkin; +Cc: tarantool-patches

[-- Attachment #1: Type: text/plain, Size: 4532 bytes --]


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

[-- Attachment #2: Type: text/html, Size: 5767 bytes --]

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [Tarantool-patches] [PATCH luajit] test: adapt disabled tests from PUC-Rio
  2021-09-24 13:58 [Tarantool-patches] [PATCH luajit] test: adapt disabled tests from PUC-Rio Maxim Kokryashkin via Tarantool-patches
  2021-09-24 14:34 ` Максим Корякшин via Tarantool-patches
@ 2021-10-08  8:54 ` Sergey Kaplun via Tarantool-patches
  2022-02-17 16:38 ` Igor Munkin via Tarantool-patches
  2 siblings, 0 replies; 12+ messages in thread
From: Sergey Kaplun via Tarantool-patches @ 2021-10-08  8:54 UTC (permalink / raw)
  To: Maxim Kokryashkin; +Cc: tarantool-patches

Hi, Maxim!

Thanks for the patch!

Please answer my questions below.

On 24.09.21, Maxim Kokryashkin wrote:
> Version and status are printed in stdout instead stderr
> since LuaJIT-2.0.0-beta11 (as it is not an error message). This behavior

Please mention the corresponding commit.

> is the same as in Lua 5.2, so necessary changes in tests can be
> adapted from PUC-Rio Lua 5.2 test suite.
> 
> Closes tarantool/tarantool#5687
> ---
> Issue: https://github.com/tarantool/tarantool/issues/5687
> Branch: https://github.com/tarantool/luajit/tree/fckxorg/gh-5687-adapt-tests-output-PUC-Rio

Please provide Tarantool branch too. It is convinient to reviewer to
check that CI is OK.

> 
>  test/PUC-Rio-Lua-5.1-tests/main.lua | 53 +++++++++++++++++++----------
>  1 file changed, 35 insertions(+), 18 deletions(-)
> 
> diff --git a/test/PUC-Rio-Lua-5.1-tests/main.lua b/test/PUC-Rio-Lua-5.1-tests/main.lua
> index 07facc4c..34e028f5 100644
> --- a/test/PUC-Rio-Lua-5.1-tests/main.lua
> +++ b/test/PUC-Rio-Lua-5.1-tests/main.lua
> @@ -24,11 +24,33 @@ local prepfile = function (s, p)

<snipped>

> +-- Test is adapted from PUC-Rio Lua 5.2 test suite.
> +-- See comment for checkprogout().
>  prepfile("a = [[b\nc\nd\ne]]\n=a")
>  print(prog)
> --- FIXME: Behavior is different for LuaJIT. See the comment above.
> --- RUN([[lua -e"_PROMPT='' _PROMPT2=''" -i < %s > %s]], prog, out)
> --- checkout("b\nc\nd\ne\n\n")
> +RUN([[lua -e"_PROMPT='' _PROMPT2=''" -i < %s > %s]], prog, out)
> +checkprogout("b\nc\nd\ne\n\n")
>  
> +-- Test is adapted from PUC-Rio Lua 5.2 test suite.
> +-- See comment for checkprogout().
>  prompt = "alo"
>  prepfile[[ --
>  a = 2
>  ]]
> --- FIXME: Behavior is different for LuaJIT. See the comment above.
> --- RUN([[lua "-e_PROMPT='%s'" -i < %s > %s]], prompt, prog, out)
> --- checkout(string.rep(prompt, 3).."\n")
> +RUN([[lua "-e_PROMPT='%s'" -i < %s > %s]], prompt, prog, out)
> +checkprogout(string.rep(prompt, 3).."\n")

Lua 5.2 test suite has the different test here:

| RUN([[lua "-e_PROMPT='%s'" -i < %s > %s]], prompt, prog, out)
| local t = getoutput()
| assert(string.find(t, prompt .. ".*" .. prompt .. ".*" .. prompt))

Why did you change it?

>  
>  s = [=[ --
>  function f ( x )

Why didn't you adjust the next test with multiple returns too?
See the issue's comment for example [1].

> -- 
> 2.33.0
> 

[1]: https://github.com/tarantool/tarantool/issues/5687#issuecomment-758682525

-- 
Best regards,
Sergey Kaplun

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [Tarantool-patches] [PATCH luajit] test: adapt disabled tests from PUC-Rio
  2021-09-24 14:34 ` Максим Корякшин via Tarantool-patches
@ 2021-10-08  8:58   ` Sergey Kaplun via Tarantool-patches
  2021-10-13 15:55     ` [Tarantool-patches] [PATCH luajit v2] " Maxim Kokryashkin via Tarantool-patches
  0 siblings, 1 reply; 12+ messages in thread
From: Sergey Kaplun via Tarantool-patches @ 2021-10-08  8:58 UTC (permalink / raw)
  To: Максим
	Корякшин
  Cc: Maxim Kokryashkin, tarantool-patches

Hi!

On 24.09.21, Максим Корякшин wrote:
> 
> Hi!
> I realized I forgot to add some refs to related issues,
> so here is the new version of the commit message:
> ====================================================
> test: adapt disabled tests from PUC-Rio
>  
> Version and status are printed in stdout instead stderr
> since LuaJIT-2.0.0-beta11 (as it is not an error message). This behavior
> is the same as in Lua 5.2, so necessary changes in tests can be
> adapted from PUC-Rio Lua 5.2 test suite.
>  
> Closes tarantool/tarantool#5687
> Part of tarantool/tarantool#5845

This issue is already closed.

> Part of tarantool/tarantool#4473

And this is kinda an umbrella for all test-suite backporting issues.
IMO, it is better to mention only 5870 [1] here.

> ====================================================
>  
> Best regards,
> Maxim Kokryashkin
>  

<snipped>

> > 

[1]: https://github.com/tarantool/tarantool/issues/5870

-- 
Best regards,
Sergey Kaplun

^ permalink raw reply	[flat|nested] 12+ messages in thread

* [Tarantool-patches] [PATCH luajit v2] test: adapt disabled tests from PUC-Rio
  2021-10-08  8:58   ` Sergey Kaplun via Tarantool-patches
@ 2021-10-13 15:55     ` Maxim Kokryashkin via Tarantool-patches
  2021-12-16 15:04       ` Sergey Kaplun via Tarantool-patches
  2022-02-16 10:37       ` Igor Munkin via Tarantool-patches
  0 siblings, 2 replies; 12+ messages in thread
From: Maxim Kokryashkin via Tarantool-patches @ 2021-10-13 15:55 UTC (permalink / raw)
  To: tarantool-patches, imun, skaplun, m.shishatskiy

Version and status are printed in stdout instead stderr
since LuaJIT-2.0.0-beta11 (as it is not an error message). This behavior
is the same as in Lua 5.2, so necessary changes in tests can be
adapted from PUC-Rio Lua 5.2 test suite.

However, those tests are disabled for Tarantool since its interactive
shell doesn't support '=' at the beginning of statements.
Here is an example:
========================================================================
$ luajit
> = (6*2-6) -- ===
6

$ tarantool
tarantool> = (6*2-6) -- ===
---
- error: ' (6*2-6) -- ===:1: unexpected symbol near ''='''
...
========================================================================

Part of tarantool/tarantool#5870
---
Changes in v2:
- Fixed comments as per review by Sergey
- Disabled some tests for Tarantool
- Added link to CI jobs

Issue: https://github.com/tarantool/tarantool/issues/5687
Branch: https://github.com/tarantool/luajit/tree/fckxorg/gh-5687-adapt-tests-output-PUC-Rio
CI: https://github.com/tarantool/tarantool/tree/fckxorg/gh-5687-adapt-disabled-tests-from-PUC-Rio

 test/PUC-Rio-Lua-5.1-tests/main.lua | 97 ++++++++++++++++++++---------
 1 file changed, 66 insertions(+), 31 deletions(-)

diff --git a/test/PUC-Rio-Lua-5.1-tests/main.lua b/test/PUC-Rio-Lua-5.1-tests/main.lua
index 07facc4c..38111560 100644
--- a/test/PUC-Rio-Lua-5.1-tests/main.lua
+++ b/test/PUC-Rio-Lua-5.1-tests/main.lua
@@ -24,11 +24,33 @@ local prepfile = function (s, p)
   assert(io.close())
 end
 
-function checkout (s)
+-- Taken from PUC-Rio Lua 5.2 test suite.
+-- See comment for checkprogout().
+function getoutput ()
   io.input(out)
   local t = io.read("*a")
   io.input():close()
   assert(os.remove(out))
+  return t
+end
+
+-- Version and status are printed in stdout instead stderr since
+-- LuaJIT-2.0.0-beta11 (as it is not an error message).
+-- See commit 0bd1a66f2f055211ef55834ccebca3b82d03c735
+-- (Print version and JIT status to stdout, not stderr.).
+-- This behavior is the same as in Lua 5.2.
+-- See also https://github.com/tarantool/tarantool/issues/5687.
+-- This function is adapted from PUC-Rio Lua 5.2 test suite.
+-- It is used for test commands with -i flag.
+function checkprogout (s)
+  local t = getoutput()
+  for line in string.gmatch(s, ".-\n") do
+    assert(string.find(t, line, 1, true))
+  end
+end
+
+function checkout (s)
+  local t = getoutput()
   if s ~= t then print(string.format("'%s' - '%s'\n", s, t)) end
   assert(s == t)
   return t
@@ -117,39 +139,52 @@ prepfile[[
 RUN("lua - < %s > %s", prog, out)
 checkout("1\tnil\n")
 
--- FIXME: Version and status are printed to stdout instead of
--- stderr since LuaJIT-2.0.0-beta11 (as it is not an error
--- message). See commit 0bd1a66f2f055211ef55834ccebca3b82d03c735
--- (Print version and JIT status to stdout, not stderr.).
--- This behavior is the same as in Lua 5.2.
--- In Lua 5.2 this feature was introduced via commit
--- 9e7de9473c65baee1f567852a778f2d33a47ea83.
--- See also https://github.com/tarantool/tarantool/issues/5687.
-prepfile[[
+-- FIXME: The following chunk is disabled for Tarantool since its interactive
+-- shell doesn't support '=' at the beginning of statements.
+-- Here is an example:
+-- $ luajit
+-- LuaJIT 2.1.0-beta3 -- Copyright (C) 2005-2017 Mike Pall. http://luajit.org/
+-- JIT: ON SSE2 SSE3 SSE4.1 BMI2 fold cse dce fwd dse narrow loop abc sink fuse
+-- > = (6*2-6) -- ===
+-- 6
+
+-- $ tarantool
+-- Tarantool 2.10.0-beta1-80-g201905544
+-- type 'help' for interactive help
+-- tarantool> = (6*2-6) -- ===
+-- ---
+-- - error: ' (6*2-6) -- ===:1: unexpected symbol near ''='''
+-- ...
+if not _TARANTOOL then
+-- Test is adapted from PUC-Rio Lua 5.2 test suite.
+-- See comment for checkprogout().
+  prepfile[[
 = (6*2-6) -- ===
 a
 = 10
 print(a)
 = a]]
--- FIXME: Behavior is different for LuaJIT. See the comment above.
--- RUN([[lua -e"_PROMPT='' _PROMPT2=''" -i < %s > %s]], prog, out)
--- checkout("6\n10\n10\n\n")
-
-prepfile("a = [[b\nc\nd\ne]]\n=a")
-print(prog)
--- FIXME: Behavior is different for LuaJIT. See the comment above.
--- RUN([[lua -e"_PROMPT='' _PROMPT2=''" -i < %s > %s]], prog, out)
--- checkout("b\nc\nd\ne\n\n")
-
-prompt = "alo"
-prepfile[[ --
+  RUN([[lua -e"_PROMPT='' _PROMPT2=''" -i < %s > %s]], prog, out)
+  checkprogout("6\n10\n10\n\n")
+
+-- Test is adapted from PUC-Rio Lua 5.2 test suite.
+-- See comment for checkprogout().
+  prepfile("a = [[b\nc\nd\ne]]\n=a")
+  print(prog)
+  RUN([[lua -e"_PROMPT='' _PROMPT2=''" -i < %s > %s]], prog, out)
+  checkprogout("b\nc\nd\ne\n\n")
+
+-- Test is adapted from PUC-Rio Lua 5.2 test suite.
+-- See comment for checkprogout().
+  prompt = "alo"
+  prepfile[[ --
 a = 2
 ]]
--- FIXME: Behavior is different for LuaJIT. See the comment above.
--- RUN([[lua "-e_PROMPT='%s'" -i < %s > %s]], prompt, prog, out)
--- checkout(string.rep(prompt, 3).."\n")
+  RUN([[lua "-e_PROMPT='%s'" -i < %s > %s]], prompt, prog, out)
+  local t = getoutput()
+  assert(string.find(t, prompt .. ".*" .. prompt .. ".*" .. prompt))
 
-s = [=[ --
+  s = [=[ --
 function f ( x )
   local a = [[
 xuxu
@@ -163,11 +198,11 @@ end
 =( f( 10 ) )
 assert( a == b )
 =f( 11 )  ]=]
-s = string.gsub(s, ' ', '\n\n')
-prepfile(s)
--- FIXME: Behavior is different for LuaJIT. See the comment above.
--- RUN([[lua -e"_PROMPT='' _PROMPT2=''" -i < %s > %s]], prog, out)
--- checkout("11\n1\t2\n\n")
+  s = string.gsub(s, ' ', '\n\n')
+  prepfile(s)
+  RUN([[lua -e"_PROMPT='' _PROMPT2=''" -i < %s > %s]], prog, out)
+  checkprogout("11\n1\t2\n\n")
+end
 
 prepfile[[#comment in 1st line without \n at the end]]
 RUN("lua %s", prog)
-- 
2.33.0


^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [Tarantool-patches] [PATCH luajit v2] test: adapt disabled tests from PUC-Rio
  2021-10-13 15:55     ` [Tarantool-patches] [PATCH luajit v2] " Maxim Kokryashkin via Tarantool-patches
@ 2021-12-16 15:04       ` Sergey Kaplun via Tarantool-patches
  2022-01-21 11:41         ` Максим Корякшин via Tarantool-patches
  2022-02-16 10:37         ` Igor Munkin via Tarantool-patches
  2022-02-16 10:37       ` Igor Munkin via Tarantool-patches
  1 sibling, 2 replies; 12+ messages in thread
From: Sergey Kaplun via Tarantool-patches @ 2021-12-16 15:04 UTC (permalink / raw)
  To: Maxim Kokryashkin; +Cc: tarantool-patches

Hi, Maxim!

Thanks for the fixes!

LGTM, except a few nits below.

On 13.10.21, Maxim Kokryashkin wrote:
> Version and status are printed in stdout instead stderr
> since LuaJIT-2.0.0-beta11 (as it is not an error message). This behavior
> is the same as in Lua 5.2, so necessary changes in tests can be
> adapted from PUC-Rio Lua 5.2 test suite.
> 
> However, those tests are disabled for Tarantool since its interactive
> shell doesn't support '=' at the beginning of statements.
> Here is an example:

OK, so maybe we should create a ticket for that (and _PROMPT feature)?
At least to mention it and wait for thumbs up.
Igor, thoughts?

> ========================================================================

Nit: it's better to use "|" for quoting in commit messages (I use "==="
only for separate iterative diff from the rest part of the mail).  See
git log 77c4a0747693a2a27745616894943746548df875 for example.
But it's just my recommendation.:)
Feel free to ignore.

> $ luajit
> > = (6*2-6) -- ===
> 6
> 
> $ tarantool
> tarantool> = (6*2-6) -- ===
> ---
> - error: ' (6*2-6) -- ===:1: unexpected symbol near ''='''
> ...
> ========================================================================
> 
> Part of tarantool/tarantool#5870
> ---
> Changes in v2:
> - Fixed comments as per review by Sergey
> - Disabled some tests for Tarantool
> - Added link to CI jobs
> 
> Issue: https://github.com/tarantool/tarantool/issues/5687
> Branch: https://github.com/tarantool/luajit/tree/fckxorg/gh-5687-adapt-tests-output-PUC-Rio
> CI: https://github.com/tarantool/tarantool/tree/fckxorg/gh-5687-adapt-disabled-tests-from-PUC-Rio
> 
>  test/PUC-Rio-Lua-5.1-tests/main.lua | 97 ++++++++++++++++++++---------
>  1 file changed, 66 insertions(+), 31 deletions(-)
> 
> diff --git a/test/PUC-Rio-Lua-5.1-tests/main.lua b/test/PUC-Rio-Lua-5.1-tests/main.lua
> index 07facc4c..38111560 100644
> --- a/test/PUC-Rio-Lua-5.1-tests/main.lua
> +++ b/test/PUC-Rio-Lua-5.1-tests/main.lua
> @@ -24,11 +24,33 @@ local prepfile = function (s, p)
>    assert(io.close())
>  end
>  
> -function checkout (s)
> +-- Taken from PUC-Rio Lua 5.2 test suite.
> +-- See comment for checkprogout().
> +function getoutput ()
>    io.input(out)
>    local t = io.read("*a")
>    io.input():close()
>    assert(os.remove(out))
> +  return t
> +end
> +
> +-- Version and status are printed in stdout instead stderr since
> +-- LuaJIT-2.0.0-beta11 (as it is not an error message).
> +-- See commit 0bd1a66f2f055211ef55834ccebca3b82d03c735
> +-- (Print version and JIT status to stdout, not stderr.).
> +-- This behavior is the same as in Lua 5.2.
> +-- See also https://github.com/tarantool/tarantool/issues/5687.
> +-- This function is adapted from PUC-Rio Lua 5.2 test suite.
> +-- It is used for test commands with -i flag.
> +function checkprogout (s)
> +  local t = getoutput()
> +  for line in string.gmatch(s, ".-\n") do
> +    assert(string.find(t, line, 1, true))
> +  end
> +end
> +
> +function checkout (s)
> +  local t = getoutput()
>    if s ~= t then print(string.format("'%s' - '%s'\n", s, t)) end
>    assert(s == t)
>    return t
> @@ -117,39 +139,52 @@ prepfile[[
>  RUN("lua - < %s > %s", prog, out)
>  checkout("1\tnil\n")
>  
> --- FIXME: Version and status are printed to stdout instead of
> --- stderr since LuaJIT-2.0.0-beta11 (as it is not an error
> --- message). See commit 0bd1a66f2f055211ef55834ccebca3b82d03c735
> --- (Print version and JIT status to stdout, not stderr.).
> --- This behavior is the same as in Lua 5.2.
> --- In Lua 5.2 this feature was introduced via commit
> --- 9e7de9473c65baee1f567852a778f2d33a47ea83.
> --- See also https://github.com/tarantool/tarantool/issues/5687.
> -prepfile[[
> +-- FIXME: The following chunk is disabled for Tarantool since its interactive
> +-- shell doesn't support '=' at the beginning of statements.
> +-- Here is an example:

Minor: linewidth for comments is 66 symbols. (Ignorable for comment with
word-for-word quotes below.)

> +-- $ luajit
> +-- LuaJIT 2.1.0-beta3 -- Copyright (C) 2005-2017 Mike Pall. http://luajit.org/
> +-- JIT: ON SSE2 SSE3 SSE4.1 BMI2 fold cse dce fwd dse narrow loop abc sink fuse
> +-- > = (6*2-6) -- ===
> +-- 6
> +
> +-- $ tarantool
> +-- Tarantool 2.10.0-beta1-80-g201905544
> +-- type 'help' for interactive help
> +-- tarantool> = (6*2-6) -- ===
> +-- ---
> +-- - error: ' (6*2-6) -- ===:1: unexpected symbol near ''='''
> +-- ...
> +if not _TARANTOOL then

Side note: like this solution much more than just comment out this
chunk!

> +-- Test is adapted from PUC-Rio Lua 5.2 test suite.
> +-- See comment for checkprogout().
> +  prepfile[[
>  = (6*2-6) -- ===
>  a
>  = 10
>  print(a)
>  = a]]
> --- FIXME: Behavior is different for LuaJIT. See the comment above.
> --- RUN([[lua -e"_PROMPT='' _PROMPT2=''" -i < %s > %s]], prog, out)
> --- checkout("6\n10\n10\n\n")
> -
> -prepfile("a = [[b\nc\nd\ne]]\n=a")
> -print(prog)
> --- FIXME: Behavior is different for LuaJIT. See the comment above.
> --- RUN([[lua -e"_PROMPT='' _PROMPT2=''" -i < %s > %s]], prog, out)
> --- checkout("b\nc\nd\ne\n\n")
> -
> -prompt = "alo"
> -prepfile[[ --
> +  RUN([[lua -e"_PROMPT='' _PROMPT2=''" -i < %s > %s]], prog, out)
> +  checkprogout("6\n10\n10\n\n")
> +
> +-- Test is adapted from PUC-Rio Lua 5.2 test suite.
> +-- See comment for checkprogout().
> +  prepfile("a = [[b\nc\nd\ne]]\n=a")
> +  print(prog)
> +  RUN([[lua -e"_PROMPT='' _PROMPT2=''" -i < %s > %s]], prog, out)
> +  checkprogout("b\nc\nd\ne\n\n")
> +
> +-- Test is adapted from PUC-Rio Lua 5.2 test suite.
> +-- See comment for checkprogout().
> +  prompt = "alo"
> +  prepfile[[ --
>  a = 2
>  ]]
> --- FIXME: Behavior is different for LuaJIT. See the comment above.
> --- RUN([[lua "-e_PROMPT='%s'" -i < %s > %s]], prompt, prog, out)
> --- checkout(string.rep(prompt, 3).."\n")
> +  RUN([[lua "-e_PROMPT='%s'" -i < %s > %s]], prompt, prog, out)
> +  local t = getoutput()
> +  assert(string.find(t, prompt .. ".*" .. prompt .. ".*" .. prompt))
>  
> -s = [=[ --
> +  s = [=[ --
>  function f ( x )
>    local a = [[
>  xuxu
> @@ -163,11 +198,11 @@ end
>  =( f( 10 ) )
>  assert( a == b )
>  =f( 11 )  ]=]
> -s = string.gsub(s, ' ', '\n\n')
> -prepfile(s)
> --- FIXME: Behavior is different for LuaJIT. See the comment above.
> --- RUN([[lua -e"_PROMPT='' _PROMPT2=''" -i < %s > %s]], prog, out)
> --- checkout("11\n1\t2\n\n")
> +  s = string.gsub(s, ' ', '\n\n')
> +  prepfile(s)
> +  RUN([[lua -e"_PROMPT='' _PROMPT2=''" -i < %s > %s]], prog, out)
> +  checkprogout("11\n1\t2\n\n")
> +end

It's nothing bad in commenting "-- not _TARANTOOL" for this `end`.
Feel free to ignore.

>  
>  prepfile[[#comment in 1st line without \n at the end]]
>  RUN("lua %s", prog)
> -- 
> 2.33.0
> 

-- 
Best regards,
Sergey Kaplun

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [Tarantool-patches]  [PATCH luajit v2] test: adapt disabled tests from PUC-Rio
  2021-12-16 15:04       ` Sergey Kaplun via Tarantool-patches
@ 2022-01-21 11:41         ` Максим Корякшин via Tarantool-patches
  2022-02-16 10:37           ` Igor Munkin via Tarantool-patches
  2022-02-16 10:37         ` Igor Munkin via Tarantool-patches
  1 sibling, 1 reply; 12+ messages in thread
From: Максим Корякшин via Tarantool-patches @ 2022-01-21 11:41 UTC (permalink / raw)
  To: Sergey Kaplun; +Cc: Maxim Kokryashkin, tarantool-patches

[-- Attachment #1: Type: text/plain, Size: 9215 bytes --]


Hi, Sergey!
Thanks for the review!
 
New commit message with your comments in mind:
=========================================================
test: adapt disabled tests from PUC-Rio
 
Version and status are printed in stdout instead of stderr
since LuaJIT-2.0.0-beta11 (as it is not an error message). This behavior
is the same as in Lua 5.2, so necessary changes in tests can be
adapted from PUC-Rio Lua 5.2 test suite.
 
However, those tests are disabled for Tarantool since its interactive
shell doesn't support '=' at the beginning of statements.
Here is an example:
|$ luajit
|> = (6*2-6) -- ===
|6
|
|$ tarantool
|tarantool> = (6*2-6) -- ===
|---
|- error: ' (6*2-6) -- ===:1: unexpected symbol near ''='''
|...
 
Part of tarantool/tarantool#5870
Resolves tarantool/tarantool#5687
=========================================================
 
And here is the diff:
=========================================================
diff --git a/test/PUC-Rio-Lua-5.1-tests/main.lua b/test/PUC-Rio-Lua-5.1-tests/main.lua
index 38111560..9c1e5fa4 100644
--- a/test/PUC-Rio-Lua-5.1-tests/main.lua
+++ b/test/PUC-Rio-Lua-5.1-tests/main.lua
@@ -139,8 +139,9 @@ prepfile[[
 RUN("lua - < %s > %s", prog, out)
 checkout("1\tnil\n")
 
--- FIXME: The following chunk is disabled for Tarantool since its interactive
--- shell doesn't support '=' at the beginning of statements.
+-- FIXME: The following chunk is disabled for Tarantool since
+-- its interactive shell doesn't support '=' at the beginning
+-- of statements.
 -- Here is an example:
 -- $ luajit
 -- LuaJIT 2.1.0-beta3 -- Copyright (C) 2005-2017 Mike Pall. http://luajit.org/
@@ -202,7 +203,7 @@ assert( a == b )
   prepfile(s)
   RUN([[lua -e"_PROMPT='' _PROMPT2=''" -i < %s > %s]], prog, out)
   checkprogout("11\n1\t2\n\n")
-end
+end -- not _TARANTOOL
 
 prepfile[[#comment in 1st line without \n at the end]]
 RUN("lua %s", prog)
=========================================================
 
New CI branch:  https://github.com/tarantool/tarantool/tree/fckxorg/gh-5687-adapt-disabled-tests-from-PUC-Rio-full-ci
 
Best regards,
Maxim Kokryashkin
 
> 
>>Hi, Maxim!
>>
>>Thanks for the fixes!
>>
>>LGTM, except a few nits below.
>>
>>On 13.10.21, Maxim Kokryashkin wrote:
>>> Version and status are printed in stdout instead stderr
>>> since LuaJIT-2.0.0-beta11 (as it is not an error message). This behavior
>>> is the same as in Lua 5.2, so necessary changes in tests can be
>>> adapted from PUC-Rio Lua 5.2 test suite.
>>>
>>> However, those tests are disabled for Tarantool since its interactive
>>> shell doesn't support '=' at the beginning of statements.
>>> Here is an example:
>>
>>OK, so maybe we should create a ticket for that (and _PROMPT feature)?
>>At least to mention it and wait for thumbs up.
>>Igor, thoughts?
>>
>>> ========================================================================
>>
>>Nit: it's better to use "|" for quoting in commit messages (I use "==="
>>only for separate iterative diff from the rest part of the mail). See
>>git log 77c4a0747693a2a27745616894943746548df875 for example.
>>But it's just my recommendation.:)
>>Feel free to ignore.
>>
>>> $ luajit
>>> > = (6*2-6) -- ===
>>> 6
>>>
>>> $ tarantool
>>> tarantool> = (6*2-6) -- ===
>>> ---
>>> - error: ' (6*2-6) -- ===:1: unexpected symbol near ''='''
>>> ...
>>> ========================================================================
>>>
>>> Part of tarantool/tarantool#5870
>>> ---
>>> Changes in v2:
>>> - Fixed comments as per review by Sergey
>>> - Disabled some tests for Tarantool
>>> - Added link to CI jobs
>>>
>>> Issue:  https://github.com/tarantool/tarantool/issues/5687
>>> Branch:  https://github.com/tarantool/luajit/tree/fckxorg/gh-5687-adapt-tests-output-PUC-Rio
>>> CI:  https://github.com/tarantool/tarantool/tree/fckxorg/gh-5687-adapt-disabled-tests-from-PUC-Rio
>>>
>>> test/PUC-Rio-Lua-5.1-tests/main.lua | 97 ++++++++++++++++++++---------
>>> 1 file changed, 66 insertions(+), 31 deletions(-)
>>>
>>> diff --git a/test/PUC-Rio-Lua-5.1-tests/main.lua b/test/PUC-Rio-Lua-5.1-tests/main.lua
>>> index 07facc4c..38111560 100644
>>> --- a/test/PUC-Rio-Lua-5.1-tests/main.lua
>>> +++ b/test/PUC-Rio-Lua-5.1-tests/main.lua
>>> @@ -24,11 +24,33 @@ local prepfile = function (s, p)
>>> assert(io.close())
>>> end
>>>
>>> -function checkout (s)
>>> +-- Taken from PUC-Rio Lua 5.2 test suite.
>>> +-- See comment for checkprogout().
>>> +function getoutput ()
>>> io.input(out)
>>> local t = io.read("*a")
>>> io.input():close()
>>> assert(os.remove(out))
>>> + return t
>>> +end
>>> +
>>> +-- Version and status are printed in stdout instead stderr since
>>> +-- LuaJIT-2.0.0-beta11 (as it is not an error message).
>>> +-- See commit 0bd1a66f2f055211ef55834ccebca3b82d03c735
>>> +-- (Print version and JIT status to stdout, not stderr.).
>>> +-- This behavior is the same as in Lua 5.2.
>>> +-- See also  https://github.com/tarantool/tarantool/issues/5687 .
>>> +-- This function is adapted from PUC-Rio Lua 5.2 test suite.
>>> +-- It is used for test commands with -i flag.
>>> +function checkprogout (s)
>>> + local t = getoutput()
>>> + for line in string.gmatch(s, ".-\n") do
>>> + assert(string.find(t, line, 1, true))
>>> + end
>>> +end
>>> +
>>> +function checkout (s)
>>> + local t = getoutput()
>>> if s ~= t then print(string.format("'%s' - '%s'\n", s, t)) end
>>> assert(s == t)
>>> return t
>>> @@ -117,39 +139,52 @@ prepfile[[
>>> RUN("lua - < %s > %s", prog, out)
>>> checkout("1\tnil\n")
>>>
>>> --- FIXME: Version and status are printed to stdout instead of
>>> --- stderr since LuaJIT-2.0.0-beta11 (as it is not an error
>>> --- message). See commit 0bd1a66f2f055211ef55834ccebca3b82d03c735
>>> --- (Print version and JIT status to stdout, not stderr.).
>>> --- This behavior is the same as in Lua 5.2.
>>> --- In Lua 5.2 this feature was introduced via commit
>>> --- 9e7de9473c65baee1f567852a778f2d33a47ea83.
>>> --- See also  https://github.com/tarantool/tarantool/issues/5687 .
>>> -prepfile[[
>>> +-- FIXME: The following chunk is disabled for Tarantool since its interactive
>>> +-- shell doesn't support '=' at the beginning of statements.
>>> +-- Here is an example:
>>
>>Minor: linewidth for comments is 66 symbols. (Ignorable for comment with
>>word-for-word quotes below.)
>>
>>> +-- $ luajit
>>> +-- LuaJIT 2.1.0-beta3 -- Copyright (C) 2005-2017 Mike Pall.  http://luajit.org/
>>> +-- JIT: ON SSE2 SSE3 SSE4.1 BMI2 fold cse dce fwd dse narrow loop abc sink fuse
>>> +-- > = (6*2-6) -- ===
>>> +-- 6
>>> +
>>> +-- $ tarantool
>>> +-- Tarantool 2.10.0-beta1-80-g201905544
>>> +-- type 'help' for interactive help
>>> +-- tarantool> = (6*2-6) -- ===
>>> +-- ---
>>> +-- - error: ' (6*2-6) -- ===:1: unexpected symbol near ''='''
>>> +-- ...
>>> +if not _TARANTOOL then
>>
>>Side note: like this solution much more than just comment out this
>>chunk!
>>
>>> +-- Test is adapted from PUC-Rio Lua 5.2 test suite.
>>> +-- See comment for checkprogout().
>>> + prepfile[[
>>> = (6*2-6) -- ===
>>> a
>>> = 10
>>> print(a)
>>> = a]]
>>> --- FIXME: Behavior is different for LuaJIT. See the comment above.
>>> --- RUN([[lua -e"_PROMPT='' _PROMPT2=''" -i < %s > %s]], prog, out)
>>> --- checkout("6\n10\n10\n\n")
>>> -
>>> -prepfile("a = [[b\nc\nd\ne]]\n=a")
>>> -print(prog)
>>> --- FIXME: Behavior is different for LuaJIT. See the comment above.
>>> --- RUN([[lua -e"_PROMPT='' _PROMPT2=''" -i < %s > %s]], prog, out)
>>> --- checkout("b\nc\nd\ne\n\n")
>>> -
>>> -prompt = "alo"
>>> -prepfile[[ --
>>> + RUN([[lua -e"_PROMPT='' _PROMPT2=''" -i < %s > %s]], prog, out)
>>> + checkprogout("6\n10\n10\n\n")
>>> +
>>> +-- Test is adapted from PUC-Rio Lua 5.2 test suite.
>>> +-- See comment for checkprogout().
>>> + prepfile("a = [[b\nc\nd\ne]]\n=a")
>>> + print(prog)
>>> + RUN([[lua -e"_PROMPT='' _PROMPT2=''" -i < %s > %s]], prog, out)
>>> + checkprogout("b\nc\nd\ne\n\n")
>>> +
>>> +-- Test is adapted from PUC-Rio Lua 5.2 test suite.
>>> +-- See comment for checkprogout().
>>> + prompt = "alo"
>>> + prepfile[[ --
>>> a = 2
>>> ]]
>>> --- FIXME: Behavior is different for LuaJIT. See the comment above.
>>> --- RUN([[lua "-e_PROMPT='%s'" -i < %s > %s]], prompt, prog, out)
>>> --- checkout(string.rep(prompt, 3).."\n")
>>> + RUN([[lua "-e_PROMPT='%s'" -i < %s > %s]], prompt, prog, out)
>>> + local t = getoutput()
>>> + assert(string.find(t, prompt .. ".*" .. prompt .. ".*" .. prompt))
>>>
>>> -s = [=[ --
>>> + s = [=[ --
>>> function f ( x )
>>> local a = [[
>>> xuxu
>>> @@ -163,11 +198,11 @@ end
>>> =( f( 10 ) )
>>> assert( a == b )
>>> =f( 11 ) ]=]
>>> -s = string.gsub(s, ' ', '\n\n')
>>> -prepfile(s)
>>> --- FIXME: Behavior is different for LuaJIT. See the comment above.
>>> --- RUN([[lua -e"_PROMPT='' _PROMPT2=''" -i < %s > %s]], prog, out)
>>> --- checkout("11\n1\t2\n\n")
>>> + s = string.gsub(s, ' ', '\n\n')
>>> + prepfile(s)
>>> + RUN([[lua -e"_PROMPT='' _PROMPT2=''" -i < %s > %s]], prog, out)
>>> + checkprogout("11\n1\t2\n\n")
>>> +end
>>
>>It's nothing bad in commenting "-- not _TARANTOOL" for this `end`.
>>Feel free to ignore.
>>
>>>
>>> prepfile[[#comment in 1st line without \n at the end]]
>>> RUN("lua %s", prog)
>>> --
>>> 2.33.0
>>>
>>
>>--
>>Best regards,
>>Sergey Kaplun
> 

[-- Attachment #2: Type: text/html, Size: 11822 bytes --]

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [Tarantool-patches] [PATCH luajit v2] test: adapt disabled tests from PUC-Rio
  2021-10-13 15:55     ` [Tarantool-patches] [PATCH luajit v2] " Maxim Kokryashkin via Tarantool-patches
  2021-12-16 15:04       ` Sergey Kaplun via Tarantool-patches
@ 2022-02-16 10:37       ` Igor Munkin via Tarantool-patches
  1 sibling, 0 replies; 12+ messages in thread
From: Igor Munkin via Tarantool-patches @ 2022-02-16 10:37 UTC (permalink / raw)
  To: Maxim Kokryashkin; +Cc: tarantool-patches

Max,

LGTM, considering post-review fixes you've made as a result of Sergey
reply, but still some nits are remaining. Please, consider one of them
below; you can find several more in the reply to post-review fixes.

On 13.10.21, Maxim Kokryashkin wrote:

<snipped>

> ---
> Changes in v2:
> - Fixed comments as per review by Sergey
> - Disabled some tests for Tarantool
> - Added link to CI jobs
> 
> Issue: https://github.com/tarantool/tarantool/issues/5687
> Branch: https://github.com/tarantool/luajit/tree/fckxorg/gh-5687-adapt-tests-output-PUC-Rio
> CI: https://github.com/tarantool/tarantool/tree/fckxorg/gh-5687-adapt-disabled-tests-from-PUC-Rio
> 
>  test/PUC-Rio-Lua-5.1-tests/main.lua | 97 ++++++++++++++++++++---------
>  1 file changed, 66 insertions(+), 31 deletions(-)
> 
> diff --git a/test/PUC-Rio-Lua-5.1-tests/main.lua b/test/PUC-Rio-Lua-5.1-tests/main.lua
> index 07facc4c..38111560 100644
> --- a/test/PUC-Rio-Lua-5.1-tests/main.lua
> +++ b/test/PUC-Rio-Lua-5.1-tests/main.lua
> @@ -24,11 +24,33 @@ local prepfile = function (s, p)
>    assert(io.close())
>  end
>  
> -function checkout (s)
> +-- Taken from PUC-Rio Lua 5.2 test suite.
> +-- See comment for checkprogout().
> +function getoutput ()
>    io.input(out)
>    local t = io.read("*a")
>    io.input():close()
>    assert(os.remove(out))
> +  return t
> +end
> +
> +-- Version and status are printed in stdout instead stderr since

Typo: s/instead/instead of/.

> +-- LuaJIT-2.0.0-beta11 (as it is not an error message).
> +-- See commit 0bd1a66f2f055211ef55834ccebca3b82d03c735
> +-- (Print version and JIT status to stdout, not stderr.).
> +-- This behavior is the same as in Lua 5.2.
> +-- See also https://github.com/tarantool/tarantool/issues/5687.
> +-- This function is adapted from PUC-Rio Lua 5.2 test suite.
> +-- It is used for test commands with -i flag.

<snipped>

> -- 
> 2.33.0
> 

-- 
Best regards,
IM

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [Tarantool-patches] [PATCH luajit v2] test: adapt disabled tests from PUC-Rio
  2022-01-21 11:41         ` Максим Корякшин via Tarantool-patches
@ 2022-02-16 10:37           ` Igor Munkin via Tarantool-patches
  0 siblings, 0 replies; 12+ messages in thread
From: Igor Munkin via Tarantool-patches @ 2022-02-16 10:37 UTC (permalink / raw)
  To: Максим
	Корякшин
  Cc: tarantool-patches, Maxim Kokryashkin

Max,

Here are the remaining nits.

On 21.01.22, Максим Корякшин wrote:
> 
> Hi, Sergey!
> Thanks for the review!
>  
> New commit message with your comments in mind:
> =========================================================
> test: adapt disabled tests from PUC-Rio
>  
> Version and status are printed in stdout instead of stderr
> since LuaJIT-2.0.0-beta11 (as it is not an error message). This behavior
> is the same as in Lua 5.2, so necessary changes in tests can be
> adapted from PUC-Rio Lua 5.2 test suite.
>  
> However, those tests are disabled for Tarantool since its interactive
> shell doesn't support '=' at the beginning of statements.
> Here is an example:
> |$ luajit
> |> = (6*2-6) -- ===
> |6
> |
> |$ tarantool
> |tarantool> = (6*2-6) -- ===
> |---
> |- error: ' (6*2-6) -- ===:1: unexpected symbol near ''='''
> |...

It's better to use a space between | and the body (like email client
does) for readability. So this part should look like this:
| $ luajit
| > = (6*2-6) -- ===
| 6
| 
| $ tarantool
| tarantool> = (6*2-6) -- ===
| ---
| - error: ' (6*2-6) -- ===:1: unexpected symbol near ''='''
| ...


>  
> Part of tarantool/tarantool#5870
> Resolves tarantool/tarantool#5687

Please, move "Resolves" tag prior to "Part of" one.

> =========================================================

<snipped>

> > 

-- 
Best regards,
IM

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [Tarantool-patches] [PATCH luajit v2] test: adapt disabled tests from PUC-Rio
  2021-12-16 15:04       ` Sergey Kaplun via Tarantool-patches
  2022-01-21 11:41         ` Максим Корякшин via Tarantool-patches
@ 2022-02-16 10:37         ` Igor Munkin via Tarantool-patches
  2022-02-17 12:01           ` Maxim Kokryashkin via Tarantool-patches
  1 sibling, 1 reply; 12+ messages in thread
From: Igor Munkin via Tarantool-patches @ 2022-02-16 10:37 UTC (permalink / raw)
  To: Sergey Kaplun; +Cc: Maxim Kokryashkin, tarantool-patches

Sergey,

On 16.12.21, Sergey Kaplun wrote:
> Hi, Maxim!
> 
> Thanks for the fixes!
> 
> LGTM, except a few nits below.
> 
> On 13.10.21, Maxim Kokryashkin wrote:
> > Version and status are printed in stdout instead stderr
> > since LuaJIT-2.0.0-beta11 (as it is not an error message). This behavior
> > is the same as in Lua 5.2, so necessary changes in tests can be
> > adapted from PUC-Rio Lua 5.2 test suite.
> > 
> > However, those tests are disabled for Tarantool since its interactive
> > shell doesn't support '=' at the beginning of statements.
> > Here is an example:
> 
> OK, so maybe we should create a ticket for that (and _PROMPT feature)?
> At least to mention it and wait for thumbs up.
> Igor, thoughts?

I guess this is not an obligatory feature, since nobody claims Tarantool
console should provide the similar interfaces LuaJIT does. IMHO, the
best solution for this would be LuaJIT compatibility flag for Tarantool
or its console, but I see no demand for this. So, it's up to you to file
a ticket or not.

> 

<snipped>

> 
> -- 
> Best regards,
> Sergey Kaplun

-- 
Best regards,
IM

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [Tarantool-patches]  [PATCH luajit v2] test: adapt disabled tests from PUC-Rio
  2022-02-16 10:37         ` Igor Munkin via Tarantool-patches
@ 2022-02-17 12:01           ` Maxim Kokryashkin via Tarantool-patches
  0 siblings, 0 replies; 12+ messages in thread
From: Maxim Kokryashkin via Tarantool-patches @ 2022-02-17 12:01 UTC (permalink / raw)
  To: Igor Munkin; +Cc: Maxim Kokryashkin, tarantool-patches

[-- Attachment #1: Type: text/plain, Size: 2912 bytes --]


Hi!
Thanks for the review!
Here is the new commit message:
======================================================
test: adapt disabled tests from PUC-Rio
 
Version and status are printed in stdout instead of stderr
since LuaJIT-2.0.0-beta11 (as it is not an error message). This behavior
is the same as in Lua 5.2, so necessary changes in tests can be
adapted from PUC-Rio Lua 5.2 test suite.
 
However, those tests are disabled for Tarantool since its interactive
shell doesn't support '=' at the beginning of statements.
Here is an example:
| $ luajit
| > = (6*2-6) -- ===
| 6
|
| $ tarantool
| tarantool> = (6*2-6) -- ===
| ---
| - error: ' (6*2-6) -- ===:1: unexpected symbol near ''='''
| ...
 
Resolves tarantool/tarantool#5687
Part of tarantool/tarantool#5870
======================================================
 
And here is the diff:
======================================================
diff --git a/test/PUC-Rio-Lua-5.1-tests/main.lua b/test/PUC-Rio-Lua-5.1-tests/main.lua
index 9c1e5fa4..9894f299 100644
--- a/test/PUC-Rio-Lua-5.1-tests/main.lua
+++ b/test/PUC-Rio-Lua-5.1-tests/main.lua
@@ -34,8 +34,8 @@ function getoutput ()
   return t
 end
 
--- Version and status are printed in stdout instead stderr since
--- LuaJIT-2.0.0-beta11 (as it is not an error message).
+-- Version and status are printed in stdout instead of stderr
+-- since LuaJIT-2.0.0-beta11 (as it is not an error message).
 -- See commit 0bd1a66f2f055211ef55834ccebca3b82d03c735
 -- (Print version and JIT status to stdout, not stderr.).
 -- This behavior is the same as in Lua 5.2.
======================================================
--
Best regards,
Maxim Kokryashkin
 
  
>Среда, 16 февраля 2022, 13:41 +03:00 от Igor Munkin <imun@tarantool.org>:
> 
>Sergey,
>
>On 16.12.21, Sergey Kaplun wrote:
>> Hi, Maxim!
>>
>> Thanks for the fixes!
>>
>> LGTM, except a few nits below.
>>
>> On 13.10.21, Maxim Kokryashkin wrote:
>> > Version and status are printed in stdout instead stderr
>> > since LuaJIT-2.0.0-beta11 (as it is not an error message). This behavior
>> > is the same as in Lua 5.2, so necessary changes in tests can be
>> > adapted from PUC-Rio Lua 5.2 test suite.
>> >
>> > However, those tests are disabled for Tarantool since its interactive
>> > shell doesn't support '=' at the beginning of statements.
>> > Here is an example:
>>
>> OK, so maybe we should create a ticket for that (and _PROMPT feature)?
>> At least to mention it and wait for thumbs up.
>> Igor, thoughts?
>
>I guess this is not an obligatory feature, since nobody claims Tarantool
>console should provide the similar interfaces LuaJIT does. IMHO, the
>best solution for this would be LuaJIT compatibility flag for Tarantool
>or its console, but I see no demand for this. So, it's up to you to file
>a ticket or not.
>
>>
>
><snipped>
>
>>
>> --
>> Best regards,
>> Sergey Kaplun
>
>--
>Best regards,
>IM
 

[-- Attachment #2: Type: text/html, Size: 4086 bytes --]

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [Tarantool-patches] [PATCH luajit] test: adapt disabled tests from PUC-Rio
  2021-09-24 13:58 [Tarantool-patches] [PATCH luajit] test: adapt disabled tests from PUC-Rio Maxim Kokryashkin via Tarantool-patches
  2021-09-24 14:34 ` Максим Корякшин via Tarantool-patches
  2021-10-08  8:54 ` [Tarantool-patches] [PATCH luajit] " Sergey Kaplun via Tarantool-patches
@ 2022-02-17 16:38 ` Igor Munkin via Tarantool-patches
  2 siblings, 0 replies; 12+ messages in thread
From: Igor Munkin via Tarantool-patches @ 2022-02-17 16:38 UTC (permalink / raw)
  To: Maxim Kokryashkin; +Cc: tarantool-patches

Max,

I've checked the patch into all long-term branches in tarantool/luajit
and bumped a new version in 1.10, 2.8 and master.

On 24.09.21, Maxim Kokryashkin wrote:
> Version and status are printed in stdout instead stderr
> since LuaJIT-2.0.0-beta11 (as it is not an error message). This behavior
> is the same as in Lua 5.2, so necessary changes in tests can be
> adapted from PUC-Rio Lua 5.2 test suite.
> 
> Closes tarantool/tarantool#5687
> ---
> Issue: https://github.com/tarantool/tarantool/issues/5687
> Branch: https://github.com/tarantool/luajit/tree/fckxorg/gh-5687-adapt-tests-output-PUC-Rio
> 
>  test/PUC-Rio-Lua-5.1-tests/main.lua | 53 +++++++++++++++++++----------
>  1 file changed, 35 insertions(+), 18 deletions(-)
> 

<snipped>

> -- 
> 2.33.0
> 

-- 
Best regards,
IM

^ permalink raw reply	[flat|nested] 12+ messages in thread

end of thread, other threads:[~2022-02-17 16:42 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-09-24 13:58 [Tarantool-patches] [PATCH luajit] test: adapt disabled tests from PUC-Rio Maxim Kokryashkin via Tarantool-patches
2021-09-24 14:34 ` Максим Корякшин via Tarantool-patches
2021-10-08  8:58   ` Sergey Kaplun via Tarantool-patches
2021-10-13 15:55     ` [Tarantool-patches] [PATCH luajit v2] " Maxim Kokryashkin via Tarantool-patches
2021-12-16 15:04       ` Sergey Kaplun via Tarantool-patches
2022-01-21 11:41         ` Максим Корякшин via Tarantool-patches
2022-02-16 10:37           ` Igor Munkin via Tarantool-patches
2022-02-16 10:37         ` Igor Munkin via Tarantool-patches
2022-02-17 12:01           ` Maxim Kokryashkin via Tarantool-patches
2022-02-16 10:37       ` Igor Munkin via Tarantool-patches
2021-10-08  8:54 ` [Tarantool-patches] [PATCH luajit] " Sergey Kaplun via Tarantool-patches
2022-02-17 16:38 ` Igor Munkin via Tarantool-patches

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox