diff --git a/test/lib/contents.lua b/test/lib/contents.lua index a1d8b9b..dec8475 100644 --- a/test/lib/contents.lua +++ b/test/lib/contents.lua @@ -55,7 +55,7 @@ do --- math end do --- pre-5.2 math +lua<5.2 -compat5.2 - assert(math.mod) + assert(not math.mod) assert(math.log10) end @@ -68,16 +68,12 @@ do --- string check(string, "byte:char:dump:find:format:gmatch:gsub:len:lower:match:rep:reverse:sub:upper", "gfind") end -do --- pre-5.2 string +lua<5.2 -compat5.2 - assert(string.gfind) -end - do --- 5.2 string +lua>=5.2 assert(not string.gfind) end do --- pre-5.2 table +lua<5.2 - check(table, "concat:foreach:foreachi:getn:insert:maxn:remove:sort", "pack:unpack:setn:new") + check(table, "concat:foreach:foreachi:getn:insert:maxn:move:remove:sort", "pack:unpack:setn:new") end do --- 5.2 table +lua>=5.2 diff --git a/test/lib/ffi/bit64.lua b/test/lib/ffi/bit64.lua index d1b47be..caca346 100644 --- a/test/lib/ffi/bit64.lua +++ b/test/lib/ffi/bit64.lua @@ -18,7 +18,7 @@ end do --- smoke band assert(tostring(band(1ll, 1, 1ll, -1)) == "1LL") - assert(tostring(band(1ll, 1, 1ull, -1)) == "1ULL") + assert(tostring(band(1ll, 1, 1ull, -1ll)) == "1ULL") end do --- smoke shl diff --git a/test/lib/ffi/redir.lua b/test/lib/ffi/redir.lua index c492055..acce97d 100644 --- a/test/lib/ffi/redir.lua +++ b/test/lib/ffi/redir.lua @@ -9,9 +9,16 @@ do --- function end do --- variable -windows - ffi.cdef[[ - int redir_bar asm("errno"); - ]] + if (jit.os == "BSD") then + -- Use "h_errno" instead, "errno" isn't defined in BSD libc. + ffi.cdef[[ + int redir_bar asm("h_errno"); + ]] + else + ffi.cdef[[ + int redir_bar asm("errno"); + ]] + end ffi.C.redir_bar = 14 assert(ffi.C.redir_bar == 14)