Skip to content

Fix stale ShortcutManager numpad-operator test#11572

Merged
niksedk merged 1 commit into
mainfrom
fix/shortcut-numpad-operator-test
Jun 12, 2026
Merged

Fix stale ShortcutManager numpad-operator test#11572
niksedk merged 1 commit into
mainfrom
fix/shortcut-numpad-operator-test

Conversation

@niksedk

@niksedk niksedk commented Jun 12, 2026

Copy link
Copy Markdown
Member

Problem

ShortcutManagerTests.GetShortcutKeyNameDifferentiatesNumpad had four InlineData rows that had been failing since 2026-06-12:

Key.Add      + NumPadAdd      → expected "NumPadAdd",      actual "Add"
Key.Subtract + NumPadSubtract → expected "NumPadSubtract", actual "Subtract"
Key.Divide   + NumPadDivide   → expected "NumPadDivide",   actual "Divide"
Key.Multiply + NumPadMultiply → expected "NumPadMultiply", actual "Multiply"

Cause

Commit 00a8dc176 ("Fix numpad +,-,*,/ shortcut keys not matching") deliberately changed ShortcutManager.GetShortcutKeyName to return the bare Key names for the four numpad arithmetic operators — they're unaffected by NumLock, have no main-keyboard equivalent, and prefixing them broke matching against the Avalonia Key names used by default shortcuts (e.g. Shift+Add waveform zoom). That commit also added a legacy-migration map converting old "NumPadAdd" tokens back to "Add".

The test's expectations (last touched in the earlier commit 228bae062) were never updated, so they contradicted the intended behavior.

Fix

Test-only change: update the four expectations to the bare names and add a comment explaining why the operators differ from other numpad keys. The production code is correct and unchanged.

All 343 UI tests pass.

🤖 Generated with Claude Code

The test expected numpad +, -, *, / to produce "NumPad"-prefixed names
("NumPadAdd" etc.), but commit 00a8dc1 deliberately changed
GetShortcutKeyName to return the bare Key names ("Add", "Subtract",
"Multiply", "Divide") for these four keys — they're unaffected by NumLock
and prefixing them broke matching against the Avalonia Key names used by
default shortcuts (e.g. Shift+Add waveform zoom). The InlineData rows were
never updated, so the test had been failing since that change.

Update the four expectations to the bare names to match the intended,
documented behavior.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@niksedk niksedk merged commit 59ac294 into main Jun 12, 2026
1 of 3 checks passed
@niksedk niksedk deleted the fix/shortcut-numpad-operator-test branch June 12, 2026 18:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant