Mercurial > wow > hotcorners
comparison 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 |
comparison
equal
deleted
inserted
replaced
| -1:000000000000 | 0:fc346da3afd9 |
|---|---|
| 1 debugstack = debug.traceback | |
| 2 strmatch = string.match | |
| 3 | |
| 4 loadfile("../LibStub.lua")() | |
| 5 | |
| 6 | |
| 7 -- Pretend like loaded libstub is old and doesn't have :IterateLibraries | |
| 8 assert(LibStub.minor) | |
| 9 LibStub.minor = LibStub.minor - 0.0001 | |
| 10 LibStub.IterateLibraries = nil | |
| 11 | |
| 12 loadfile("../LibStub.lua")() | |
| 13 | |
| 14 assert(type(LibStub.IterateLibraries)=="function") | |
| 15 | |
| 16 | |
| 17 -- Now pretend that we're the same version -- :IterateLibraries should NOT be re-created | |
| 18 LibStub.IterateLibraries = 123 | |
| 19 | |
| 20 loadfile("../LibStub.lua")() | |
| 21 | |
| 22 assert(LibStub.IterateLibraries == 123) | |
| 23 | |
| 24 | |
| 25 -- Now pretend that a newer version is loaded -- :IterateLibraries should NOT be re-created | |
| 26 LibStub.minor = LibStub.minor + 0.0001 | |
| 27 | |
| 28 loadfile("../LibStub.lua")() | |
| 29 | |
| 30 assert(LibStub.IterateLibraries == 123) | |
| 31 | |
| 32 | |
| 33 -- Again with a huge number | |
| 34 LibStub.minor = LibStub.minor + 1234567890 | |
| 35 | |
| 36 loadfile("../LibStub.lua")() | |
| 37 | |
| 38 assert(LibStub.IterateLibraries == 123) | |
| 39 | |
| 40 | |
| 41 print("OK") |
