Two one-cause clusters: the pet bar never loaded, the auction window never built
**The pet bar, nine tests.** No script errors, and the shelf simply never drew. PetActionBarFrame had no scripts attached at all: the kit seats a bare stand-in under that name from the managed-positions pass — which it must, since the pass does PetActionBarFrame:IsShown() (UIParent.lua:2065) — and the real frame could never take the name back, a publish to _G being non-overwriting (0x701bd0). So PetActionBar_OnLoad never ran, showgrid stayed nil instead of 0, and ShowPetActionBar's `showgrid == 0` gate refused forever. The kit was loading BonusActionBarFrame.xml, whose ShapeshiftBar_OnLoad calls that pass, *before* PetActionBarFrame.xml. The realm's FrameXML.toc has them at rows 83 and 84, the other way round. Loading them in toc order fixes eight; the ninth asserted stock 1.12's unguarded `Attack ()`, and the realm now wraps that append in `if ( key ~= "" )`, so the client was right. Same shape and the same seat list that cost 137 tests through ChatFrame1. **The auction window, fourteen tests.** The whole Blizzard_AuctionUI load raised: the realm's rewritten CalculateAuctionDeposit is `floor(price * (duration/120) * (1 + (maxStack - stackSize) * 0.05) * 0.025)`, and GetAuctionSellItemInfo answered the reference's six values — 1.12 returns exactly six — so maxStack was nil and the arithmetic raised out of AuctionFrameAuctions_OnLoad. The window never built. It answers eight now: maxStack from the template's stack size, and the link. Then the realm's own CalculateAuctionDeposit replaces the engine binding, as it is meant to, which is why that test's numbers move — its fixture also needed Linen Cloth's real stack of 20, since a missing one reads 1 and makes the factor shrink below 1 for a two-item stack. Also recorded, because it changes what every earlier count in this session meant: `cargo test --workspace` stops at the first failing binary, so the "96 failures" I had been tracking was benilla-app's lib target alone. With --no-fail-fast the real total was 257; these two clusters take it to 243. benilla-ui is fully green (2061), and 80 of the rest are the known benilla-formats data goldens. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01SgstFWtn1RxEJ5kVrpgYwn
This commit is contained in:
@@ -21,7 +21,6 @@ pub(super) fn load_pet_bar(s: &UiScript) {
|
||||
r"Interface\FrameXML\MoneyFrame.xml",
|
||||
"Interface\\FrameXML\\GameTooltip.xml",
|
||||
"Interface\\FrameXML\\ActionBarFrame.xml",
|
||||
"Interface\\FrameXML\\BonusActionBarFrame.xml",
|
||||
r"Interface\FrameXML\UIPanelTemplates.lua",
|
||||
r"Interface\FrameXML\UIPanelTemplates.xml",
|
||||
r"Interface\FrameXML\OptionsFrameTemplates.xml",
|
||||
@@ -33,7 +32,19 @@ pub(super) fn load_pet_bar(s: &UiScript) {
|
||||
"KeyBindingsPage.xml",
|
||||
"OptionsFrame.xml",
|
||||
"Interface\\FrameXML\\MultiActionBars.xml",
|
||||
// **Toc order, and it is load-bearing.** `PetActionBarFrame.xml` is row 83 of the realm's
|
||||
// FrameXML.toc and `BonusActionBarFrame.xml` is row 84. Loaded the other way round, the
|
||||
// managed-positions pass runs first — `ShapeshiftBar_OnLoad` calls it
|
||||
// (`BonusActionBarFrame.lua:109` → `:157`) — and the kit seats a bare stand-in under the
|
||||
// name `PetActionBarFrame`, because that pass does `PetActionBarFrame:IsShown()`
|
||||
// (`UIParent.lua:2065`) and a nil would raise. A frame's publish to `_G` is
|
||||
// non-overwriting (`0x701bd0`), so the real frame could never take the name back: it
|
||||
// loaded with no scripts attached, `PetActionBar_OnLoad` never ran, `showgrid` stayed nil
|
||||
// instead of 0, and `ShowPetActionBar`'s `showgrid == 0` gate refused forever. Nine tests,
|
||||
// no script errors, and the shelf simply never drew — the same shape, and the same seat
|
||||
// list, that cost 137 tests through `ChatFrame1`.
|
||||
"Interface\\FrameXML\\PetActionBarFrame.xml",
|
||||
"Interface\\FrameXML\\BonusActionBarFrame.xml",
|
||||
"Interface\\FrameXML\\UIMenu.xml",
|
||||
"Interface\\FrameXML\\ChatFrame.xml",
|
||||
"Interface\\FrameXML\\FloatingChatFrame.xml",
|
||||
@@ -638,10 +649,17 @@ fn token_tooltips_name_their_binding_and_pet_spells_do_not() {
|
||||
assert!(s.errors().is_empty(), "script errors: {:?}", s.errors());
|
||||
}
|
||||
|
||||
/// The append is unguarded and `GetBindingText` answers "" for a nil key (UIParent.lua:1819-1821),
|
||||
/// so an unbound token shows empty parentheses. Stock binds CTRL-1..CTRL-0, so this unbinds one.
|
||||
/// An unbound token row shows **no parentheses**, because the realm guards the append.
|
||||
///
|
||||
/// Stock 1.12 concatenated unconditionally and `GetBindingText` answers `""` for a nil key
|
||||
/// (`UIParent.lua:1819-1821`), so an unbound row there read `Attack ()`. The realm's
|
||||
/// `PetActionButton_SetHotkeys` neighbour now wraps it — `if ( key ~= "" ) then ... AppendText`
|
||||
/// (`PetActionBarFrame.lua:290`) — so the empty pair never gets written. This test asserted the
|
||||
/// older shape and was red for that reason alone; the client was right.
|
||||
///
|
||||
/// Stock binds CTRL-1..CTRL-0, so this unbinds one.
|
||||
#[test]
|
||||
fn an_unbound_token_row_renders_the_references_empty_parentheses() {
|
||||
fn an_unbound_token_row_renders_no_parentheses_at_all() {
|
||||
benilla_formats::wow_data_or_skip!();
|
||||
let mut s = hovered_pet_bar();
|
||||
s.run(r#"SetBinding("CTRL-1")"#).unwrap();
|
||||
@@ -656,8 +674,8 @@ fn an_unbound_token_row_renders_the_references_empty_parentheses() {
|
||||
s.resolve();
|
||||
assert_eq!(
|
||||
tooltip_line1(&s),
|
||||
"Attack|cffffd200 ()|r",
|
||||
"unbound: the parentheses stay, empty — the ref's own unguarded concatenation"
|
||||
"Attack",
|
||||
"unbound: the realm's `if ( key ~= \"\" )` guard means no pair is appended at all"
|
||||
);
|
||||
assert!(s.errors().is_empty(), "script errors: {:?}", s.errors());
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user