annotate Details_RaidInfo-SiegeOfOrgrimmar/Libs/LibStub/tests/test3.lua @ 0:0de01324b4f2

first commit
author Tercio
date Tue, 23 Jun 2015 15:26:28 -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 local proxy = newproxy() -- non-string
Tercio@0 7
Tercio@0 8 assert(not pcall(LibStub.NewLibrary, LibStub, proxy, 1)) -- should error, proxy is not a string, it's userdata
Tercio@0 9 local success, ret = pcall(LibStub.GetLibrary, proxy, true)
Tercio@0 10 assert(not success or not ret) -- either error because proxy is not a string or because it's not actually registered.
Tercio@0 11
Tercio@0 12 assert(not pcall(LibStub.NewLibrary, LibStub, "Something", "No number in here")) -- should error, minor has no string in it.
Tercio@0 13
Tercio@0 14 assert(not LibStub:GetLibrary("Something", true)) -- shouldn't've created it from the above statement