Disable some anti-Musl Lua tests

This commit is contained in:
Justine Tunney 2024-08-17 02:20:08 -07:00
parent b2a1811c01
commit 1d532ba3f8
No known key found for this signature in database
GPG key ID: BE714B4575D6E328
2 changed files with 29 additions and 24 deletions

View file

@ -294,30 +294,31 @@ end
-- testing decimal point locale -- testing decimal point locale
if os.setlocale("pt_BR") or os.setlocale("ptb") then -- <disabled by jart: doesn't play nice with musl locale faking>
assert(tonumber("3,4") == 3.4 and tonumber"3.4" == 3.4) -- if os.setlocale("pt_BR") or os.setlocale("ptb") then
assert(tonumber(" -.4 ") == -0.4) -- assert(tonumber("3,4") == 3.4 and tonumber"3.4" == 3.4)
assert(tonumber(" +0x.41 ") == 0X0.41) -- assert(tonumber(" -.4 ") == -0.4)
assert(not load("a = (3,4)")) -- assert(tonumber(" +0x.41 ") == 0X0.41)
assert(assert(load("return 3.4"))() == 3.4) -- assert(not load("a = (3,4)"))
assert(assert(load("return .4,3"))() == .4) -- assert(assert(load("return 3.4"))() == 3.4)
assert(assert(load("return 4."))() == 4.) -- assert(assert(load("return .4,3"))() == .4)
assert(assert(load("return 4.+.5"))() == 4.5) -- assert(assert(load("return 4."))() == 4.)
-- assert(assert(load("return 4.+.5"))() == 4.5)
assert(" 0x.1 " + " 0x,1" + "-0X.1\t" == 0x0.1) -- assert(" 0x.1 " + " 0x,1" + "-0X.1\t" == 0x0.1)
assert(not tonumber"inf" and not tonumber"NAN") -- assert(not tonumber"inf" and not tonumber"NAN")
assert(assert(load(string.format("return %q", 4.51)))() == 4.51) -- assert(assert(load(string.format("return %q", 4.51)))() == 4.51)
local a,b = load("return 4.5.") -- local a,b = load("return 4.5.")
assert(string.find(b, "'4%.5%.'")) -- assert(string.find(b, "'4%.5%.'"))
assert(os.setlocale("C")) -- assert(os.setlocale("C"))
else -- else
(Message or print)( -- (Message or print)(
'\n >>> pt_BR locale not available: skipping decimal point tests <<<\n') -- '\n >>> pt_BR locale not available: skipping decimal point tests <<<\n')
end -- end
-- testing %q x line ends -- testing %q x line ends

View file

@ -430,14 +430,18 @@ if not _port then
end end
if trylocale("collate") then if trylocale("collate") then
assert("alo" < "álo" and "álo" < "amo") -- <disabled by jart: doesn't play nice with musl locale faking>
-- assert("alo" < "álo" and "álo" < "amo")
-- </disabled by jart>
end end
if trylocale("ctype") then if trylocale("ctype") then
assert(string.gsub("áéíóú", "%a", "x") == "xxxxx") -- <disabled by jart: doesn't play nice with musl locale faking>
assert(string.gsub("áÁéÉ", "%l", "x") == "xÁxÉ") -- assert(string.gsub("áéíóú", "%a", "x") == "xxxxx")
assert(string.gsub("áÁéÉ", "%u", "x") == "áxéx") -- assert(string.gsub("áÁéÉ", "%l", "x") == "xÁxÉ")
assert(string.upper"áÁé{xuxu}ção" == "ÁÁÉ{XUXU}ÇÃO") -- assert(string.gsub("áÁéÉ", "%u", "x") == "áxéx")
-- assert(string.upper"áÁé{xuxu}ção" == "ÁÁÉ{XUXU}ÇÃO")
-- </disabled by jart>
end end
os.setlocale("C") os.setlocale("C")