Mercurial > wow > hotcorners
annotate Libs/LibStub/tests/test4.lua @ 0:fc346da3afd9
First commit Hot Corners standalone.
author | tercio |
---|---|
date | Fri, 08 Aug 2014 12:35:17 -0300 |
parents | |
children |
rev | line source |
---|---|
tercio@0 | 1 debugstack = debug.traceback |
tercio@0 | 2 strmatch = string.match |
tercio@0 | 3 |
tercio@0 | 4 loadfile("../LibStub.lua")() |
tercio@0 | 5 |
tercio@0 | 6 |
tercio@0 | 7 -- Pretend like loaded libstub is old and doesn't have :IterateLibraries |
tercio@0 | 8 assert(LibStub.minor) |
tercio@0 | 9 LibStub.minor = LibStub.minor - 0.0001 |
tercio@0 | 10 LibStub.IterateLibraries = nil |
tercio@0 | 11 |
tercio@0 | 12 loadfile("../LibStub.lua")() |
tercio@0 | 13 |
tercio@0 | 14 assert(type(LibStub.IterateLibraries)=="function") |
tercio@0 | 15 |
tercio@0 | 16 |
tercio@0 | 17 -- Now pretend that we're the same version -- :IterateLibraries should NOT be re-created |
tercio@0 | 18 LibStub.IterateLibraries = 123 |
tercio@0 | 19 |
tercio@0 | 20 loadfile("../LibStub.lua")() |
tercio@0 | 21 |
tercio@0 | 22 assert(LibStub.IterateLibraries == 123) |
tercio@0 | 23 |
tercio@0 | 24 |
tercio@0 | 25 -- Now pretend that a newer version is loaded -- :IterateLibraries should NOT be re-created |
tercio@0 | 26 LibStub.minor = LibStub.minor + 0.0001 |
tercio@0 | 27 |
tercio@0 | 28 loadfile("../LibStub.lua")() |
tercio@0 | 29 |
tercio@0 | 30 assert(LibStub.IterateLibraries == 123) |
tercio@0 | 31 |
tercio@0 | 32 |
tercio@0 | 33 -- Again with a huge number |
tercio@0 | 34 LibStub.minor = LibStub.minor + 1234567890 |
tercio@0 | 35 |
tercio@0 | 36 loadfile("../LibStub.lua")() |
tercio@0 | 37 |
tercio@0 | 38 assert(LibStub.IterateLibraries == 123) |
tercio@0 | 39 |
tercio@0 | 40 |
tercio@0 | 41 print("OK") |