diff --git a/tests.lua b/tests.lua index 5d70789..0c73e30 100644 --- a/tests.lua +++ b/tests.lua @@ -1,32 +1,7 @@ --- This library targets Lua 5.1. To run the tests using Lua 5.4, the following functions are needed. -unpack = unpack or table.unpack -math.frexp = frexp or function(num) - if num == math.huge then return num end - local fraction, exponent = num, 0 - if fraction ~= 0 then - while fraction >= 1 do - fraction = fraction / 2 - exponent = exponent + 1 - end - while fraction < 0.5 do - fraction = fraction * 2 - exponent = exponent - 1 - end - end - return fraction, exponent -end -math.ldexp = math.ldexp or function(m, e) - return m * 2 ^ e -end - local LibSerialize = LibStub and LibStub:GetLibrary("LibSerialize") or require("LibSerialize") -local pairs = pairs -local type = type -local tostring = tostring -local assert = assert +-- Compatibility with Lua 5.4 local unpack = unpack or table.unpack -local pcall = pcall function LibSerialize:RunTests() --[[---------------------------------------------------------------------------