The generic "spec <name>" branch matched before the "spec clear" check, so clearing an override set overrideSpec to "Clear" and the UI then looked for a spec called Clear instead of falling back to auto-detection. Check the clear command first, collapse whitespace so "spec clear" parses, and refresh the frame immediately when the override changes. Spec names are also title-cased per word now, so "/amibis spec beast mastery" resolves to "Beast Mastery". Add test_slash.lua covering set/clear, case/whitespace normalization, and the clear-as-spec-name regression. 93 tests passing.
29 lines
967 B
Lua
29 lines
967 B
Lua
-- Offline test-suite entry point for Amibis.
|
|
--
|
|
-- Usage, from the repository root:
|
|
-- lua5.4 Amibis/Tests/run.lua
|
|
--
|
|
-- Requires only a Lua 5.3+ interpreter. No external libraries, no WoW client.
|
|
-- WoW API calls are mocked by wow_mocks.lua; SavedVariables globals are
|
|
-- stubbed below (in-game they are created by InitializeDB on ADDON_LOADED).
|
|
|
|
local ADDON_NAME = "Amibis"
|
|
local ns = {}
|
|
|
|
dofile("Amibis/Tests/harness.lua")
|
|
dofile("Amibis/Tests/wow_mocks.lua")
|
|
|
|
_G.AmibisDB = { selectedPhase = "T6" }
|
|
_G.AmibisCharDB = {}
|
|
|
|
assert(loadfile("Amibis/Amibis.lua"))(ADDON_NAME, ns)
|
|
assert(loadfile("Amibis/Data/BISLists.lua"))(ADDON_NAME, ns)
|
|
|
|
assert(loadfile("Amibis/Tests/test_data.lua"))(ADDON_NAME, ns)
|
|
assert(loadfile("Amibis/Tests/test_stats.lua"))(ADDON_NAME, ns)
|
|
assert(loadfile("Amibis/Tests/test_compare.lua"))(ADDON_NAME, ns)
|
|
assert(loadfile("Amibis/Tests/test_slash.lua"))(ADDON_NAME, ns)
|
|
|
|
local success = TestHarness_report()
|
|
os.exit(success and 0 or 1)
|