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