locale-related tests aren't guarded by _port in testes/literals.lua

38 views
Skip to first unread message

Yao Zi

unread,
Mar 27, 2026, 6:24:43 AM (10 days ago) Mar 27
to lua-l, Yao Zi
Hi list,

I'm experimenting with Lua tests shipped along with Lua Git
repository[1], and found a failure in literals.lua,

.../lua: literals.lua:300: assertion failed!
stack traceback:
[C]: in global 'assert'
literals.lua:300: in main chunk
[C]: in local 'olddofile'
all.lua:171: in main chunk
[C]: in ?
.>>> closing state <<<

and literals.lua:300 looks like

-- testing decimal point locale
if os.setlocale("pt_BR") or os.setlocale("ptb") then
assert(tonumber("3,4") == 3.4 and tonumber"3.4" == 3.4)
assert(tonumber(" -.4 ") == -0.4)

Since I'm running the test on a musl-libc system which doesn't have full
support for locale-related stuff, I've passed -e '_port=true' when
invoking Lua interpreter to test portable behaviors only. While this
parameter correctly disables non-portable tests related to locales in
strings.lua, it doesn't seem to disable such stuff in literals.lua.

Is it intended or a mistake to leave the locale-related test in
literals.lua unguarded? Thanks for the explanation.

Regards,
Yao Zi

[1]: https://github.com/lua/lua/
Reply all
Reply to author
Forward
0 new messages