[Tarantool-patches] [PATCH v2 luajit 17/30] test: disable locale-depended tests for Lua suite

Igor Munkin imun at tarantool.org
Wed Mar 31 01:16:41 MSK 2021


Sergey,

Thanks for the patch! LGTM, except the nits below.

On 26.03.21, Sergey Kaplun wrote:
> LuaJIT doesn't compare strings by `strcoll()`, like Lua 5.1 does.
> So locale-depended tests in <strings.lua> are disabled.

Side note: unfortunately, this is not mentioned anywhere except the
sources... Classic.

> 
> Also, LuaJIT doesn't use `strtod()` depended on the locale for parsing,

Typo: s/depended/dependent/.

> unlike Lua does. See <src/lj_strscan.c> for more info.
> Locale-depended tests in <literals.lua> are disabled.

Minor: Please, refer the docs[1] or the patch[2] changing the behaviour
in the commit message.

> 
> Part of tarantool/tarantool#5845
> Part of tarantool/tarantool#4473
> ---
>  test/PUC-Lua-5.1-tests/literals.lua | 5 +++++
>  test/PUC-Lua-5.1-tests/strings.lua  | 5 +++++
>  2 files changed, 10 insertions(+)
> 
> diff --git a/test/PUC-Lua-5.1-tests/literals.lua b/test/PUC-Lua-5.1-tests/literals.lua
> index 01d84d5..1b4f664 100644
> --- a/test/PUC-Lua-5.1-tests/literals.lua
> +++ b/test/PUC-Lua-5.1-tests/literals.lua
> @@ -158,6 +158,10 @@ end
>  
>  
>  -- testing decimal point locale
> +-- LuaJIT: LuaJIT doesn't use `strtod()` depended on the locale,

Typo: s/depended/dependent/.

> +-- unlike Lua does. See <src/lj_strscan.c> for more info.
> +-- Tests are disabled for LuaJIT.
> +--[[
>  if os.setlocale("pt_BR") or os.setlocale("ptb") then
>    assert(tonumber("3,4") == 3.4 and tonumber"3.4" == nil)
>    assert(assert(loadstring("return 3.4"))() == 3.4)

<snipped>

> -- 
> 2.31.0
> 

[1]: http://luajit.org/extensions.html#tonumber
[2]: https://github.com/tarantool/luajit/commit/4c882fe

-- 
Best regards,
IM


More information about the Tarantool-patches mailing list