mirror of
https://github.com/jart/cosmopolitan.git
synced 2025-02-07 06:53:33 +00:00
Disable some anti-Musl Lua tests
This commit is contained in:
parent
b2a1811c01
commit
1d532ba3f8
2 changed files with 29 additions and 24 deletions
39
third_party/lua/test/literals.lua
vendored
39
third_party/lua/test/literals.lua
vendored
|
@ -294,30 +294,31 @@ end
|
|||
|
||||
|
||||
-- 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)
|
||||
assert(tonumber(" +0x.41 ") == 0X0.41)
|
||||
assert(not load("a = (3,4)"))
|
||||
assert(assert(load("return 3.4"))() == 3.4)
|
||||
assert(assert(load("return .4,3"))() == .4)
|
||||
assert(assert(load("return 4."))() == 4.)
|
||||
assert(assert(load("return 4.+.5"))() == 4.5)
|
||||
-- <disabled by jart: doesn't play nice with musl locale faking>
|
||||
-- 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)
|
||||
-- assert(tonumber(" +0x.41 ") == 0X0.41)
|
||||
-- assert(not load("a = (3,4)"))
|
||||
-- assert(assert(load("return 3.4"))() == 3.4)
|
||||
-- assert(assert(load("return .4,3"))() == .4)
|
||||
-- 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.")
|
||||
assert(string.find(b, "'4%.5%.'"))
|
||||
-- local a,b = load("return 4.5.")
|
||||
-- assert(string.find(b, "'4%.5%.'"))
|
||||
|
||||
assert(os.setlocale("C"))
|
||||
else
|
||||
(Message or print)(
|
||||
'\n >>> pt_BR locale not available: skipping decimal point tests <<<\n')
|
||||
end
|
||||
-- assert(os.setlocale("C"))
|
||||
-- else
|
||||
-- (Message or print)(
|
||||
-- '\n >>> pt_BR locale not available: skipping decimal point tests <<<\n')
|
||||
-- end
|
||||
|
||||
|
||||
-- testing %q x line ends
|
||||
|
|
14
third_party/lua/test/strings.lua
vendored
14
third_party/lua/test/strings.lua
vendored
|
@ -430,14 +430,18 @@ if not _port then
|
|||
end
|
||||
|
||||
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
|
||||
|
||||
if trylocale("ctype") then
|
||||
assert(string.gsub("áéíóú", "%a", "x") == "xxxxx")
|
||||
assert(string.gsub("áÁéÉ", "%l", "x") == "xÁxÉ")
|
||||
assert(string.gsub("áÁéÉ", "%u", "x") == "áxéx")
|
||||
assert(string.upper"áÁé{xuxu}ção" == "ÁÁÉ{XUXU}ÇÃO")
|
||||
-- <disabled by jart: doesn't play nice with musl locale faking>
|
||||
-- assert(string.gsub("áéíóú", "%a", "x") == "xxxxx")
|
||||
-- assert(string.gsub("áÁéÉ", "%l", "x") == "xÁxÉ")
|
||||
-- assert(string.gsub("áÁéÉ", "%u", "x") == "áxéx")
|
||||
-- assert(string.upper"áÁé{xuxu}ção" == "ÁÁÉ{XUXU}ÇÃO")
|
||||
-- </disabled by jart>
|
||||
end
|
||||
|
||||
os.setlocale("C")
|
||||
|
|
Loading…
Reference in a new issue