Add /tfb test mode for previewing target buffs and debuffs

- /tfb test [buffs debuffs] and an options-panel button fill the target frame
  with fake auras (default 32 buffs, 16 debuffs) to check layout, stacks,
  borders, timers and sweeps. Targets the player if nothing is targeted.
- Fake auras restart when they expire so timers keep running.
- Works on the native path too (icons, stacks, borders only).
- Bump to 0.9.4; tests now 21 scenarios.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_019W3rwutyoLNHxXPycYWSMc
This commit is contained in:
2026-11-01 00:22:03 +00:00
co-authored by Claude Sonnet 5.5
parent 09784ec5b2
commit cbf459104b
7 changed files with 153 additions and 11 deletions
+27
View File
@@ -226,6 +226,33 @@ TargetFrameDebuff1.cd={readable={}}
Tick(); Tick()
for _,m in ipairs(messages) do assert(not string.find(m,"Debuff Timer",1,true)) end
''')
run("test mode fills all 32 buffs and 16 debuffs, then restores real auras", 'InstallAPI(true); auras.HELPFUL={Aura("Real")}', '''
Tick(); assert(TargetFrameBuff1Icon.texture=="Real" and not TargetFrameBuff2:IsShown())
SlashCmdList.TARGETFRAMEBUFF("test")
assert(TargetFrameBuff_IsTest())
for i=1,32 do assert(_G["TargetFrameBuff"..i]:IsShown() and _G["TargetFrameBuff"..i].timer.text) end
for i=1,16 do assert(_G["TargetFrameDebuff"..i]:IsShown() and _G["TargetFrameDebuff"..i].timer.text) end
assert(TargetFrameBuff5.auraBorder:IsShown() and not TargetFrameBuff6.auraBorder:IsShown())
assert(TargetFrameBuff4.auraCount.text==6)
this=TargetFrameBuff3; this.scripts.OnEnter()
assert(GameTooltip.tooltip==nil)
now=now+500; Tick(); TargetFrameBuff_OnUpdate(1)
for i=1,32 do assert(_G["TargetFrameBuff"..i]:IsShown()) end
SlashCmdList.TARGETFRAMEBUFF("test")
assert(not TargetFrameBuff_IsTest())
assert(TargetFrameBuff1Icon.texture=="Real" and not TargetFrameBuff2:IsShown())
''')
run("test mode custom counts, clamping, native path and bad input", 'nativeBuffs={}; nativeDebuffs={}', '''
SlashCmdList.TARGETFRAMEBUFF("test 3 5")
assert(TargetFrameBuff3:IsShown() and not TargetFrameBuff4:IsShown())
assert(TargetFrameDebuff5:IsShown() and not TargetFrameDebuff6:IsShown())
SlashCmdList.TARGETFRAMEBUFF("test 40 99")
assert(TargetFrameBuff32:IsShown() and TargetFrameDebuff16:IsShown())
SlashCmdList.TARGETFRAMEBUFF("test banana")
assert(TargetFrameBuff_IsTest())
SlashCmdList.TARGETFRAMEBUFF("test off")
assert(not TargetFrameBuff_IsTest() and not TargetFrameBuff1:IsShown() and not TargetFrameDebuff1:IsShown())
''')
ET.parse(addon/"TargetFrameBuff.xml")
print("PASS XML parsing")
print(f"{passed} Lua regression scenarios passed; XML parsed.")