view Libs/LibStub/tests/test4.lua @ 5:789bf9e40966

Version v0.6 change log: - new command /hansgar users: show who is using the addon in the raid. - new command /hansgar lock: lock or unlock the frame. - new command /hansgar dance: toggle the dance bar. - fixed the cooldown animation.
author Tercio
date Thu, 05 Mar 2015 16:30:25 -0300
parents 1c3534391efb
children
line wrap: on
line source
debugstack = debug.traceback
strmatch = string.match

loadfile("../LibStub.lua")()


-- Pretend like loaded libstub is old and doesn't have :IterateLibraries
assert(LibStub.minor)
LibStub.minor = LibStub.minor - 0.0001
LibStub.IterateLibraries = nil

loadfile("../LibStub.lua")()

assert(type(LibStub.IterateLibraries)=="function")


-- Now pretend that we're the same version -- :IterateLibraries should NOT be re-created
LibStub.IterateLibraries = 123

loadfile("../LibStub.lua")()

assert(LibStub.IterateLibraries == 123)


-- Now pretend that a newer version is loaded -- :IterateLibraries should NOT be re-created
LibStub.minor = LibStub.minor + 0.0001

loadfile("../LibStub.lua")()

assert(LibStub.IterateLibraries == 123)


-- Again with a huge number
LibStub.minor = LibStub.minor + 1234567890

loadfile("../LibStub.lua")()

assert(LibStub.IterateLibraries == 123)


print("OK")