[PR #11253] [MERGED] Fix UIA Word movement tests #28476

Open
opened 2026-01-31 09:28:46 +00:00 by claunia · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/microsoft/terminal/pull/11253
Author: @carlos-zamora
Created: 9/17/2021
Status: Merged
Merged: 9/22/2021
Merged by: @undefined

Base: mainHead: dev/cazamor/a11y-7000/word-nav-test-fixing


📝 Commits (3)

📊 Changes

5 files changed (+87 additions, -56 deletions)

View changed files

📝 src/interactivity/win32/ut_interactivity_win32/GeneratedUiaTextRangeMovementTests.g.cpp (+30 -30)
📝 src/interactivity/win32/ut_interactivity_win32/UiaTextRangeTests.cpp (+4 -2)
📝 src/types/UiaTextRangeBase.cpp (+28 -0)
📝 src/types/UiaTextRangeBase.hpp (+1 -0)
📝 tools/TestTableWriter/UiaTests.csv (+24 -24)

📄 Description

Summary of the Pull Request

Fixes the 24 failing generated tests. 20 of them were fixed by enforcing the following rule: when moving backwards by word...

  • a degenerate range moves to the beginning of the word, then to the word behind it.
  • a non-degenerate range outright moves to the word behind it.

The fix was simple: if we're a degenerate range, check if we're at the beginning of the word. If not, move there. Otherwise, move to the word before it. See UiaTextRangeBase.cpp changes for implementation details.

Along the way, several misauthored tests were found:

  • 2 generated tests:
    • Cause: MS Word considers a line break a word delimiter. We don't use line-wrapping to distinguish two separate words.
  • MovementAtExclusiveEnd backwards word movement tests:
    • end will always be writeTarget because...
      • [degenerate range case] both start and end are moved to the beginning of the word (writeTarget)
      • [non-degenerate range case] from the UiaTextRangeBase bugfix, we should be moving to the word behind it.
    • this misauthored test was explicitly found by fixing the bug first explained here.

References

#10925 Word navigation testing


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/microsoft/terminal/pull/11253 **Author:** [@carlos-zamora](https://github.com/carlos-zamora) **Created:** 9/17/2021 **Status:** ✅ Merged **Merged:** 9/22/2021 **Merged by:** [@undefined](undefined) **Base:** `main` ← **Head:** `dev/cazamor/a11y-7000/word-nav-test-fixing` --- ### 📝 Commits (3) - [`ef1e31a`](https://github.com/microsoft/terminal/commit/ef1e31a88f1eb64a64e1962568e9b090a2e0d24e) Fix UIA Word movement tests - [`3a83db4`](https://github.com/microsoft/terminal/commit/3a83db4bccbe743da79ff45af4e09cb62fbbbb31) add function to simplify logic a bit - [`606105c`](https://github.com/microsoft/terminal/commit/606105ce4520fed4d416015e8f40858bb93ba6e1) fix comment ### 📊 Changes **5 files changed** (+87 additions, -56 deletions) <details> <summary>View changed files</summary> 📝 `src/interactivity/win32/ut_interactivity_win32/GeneratedUiaTextRangeMovementTests.g.cpp` (+30 -30) 📝 `src/interactivity/win32/ut_interactivity_win32/UiaTextRangeTests.cpp` (+4 -2) 📝 `src/types/UiaTextRangeBase.cpp` (+28 -0) 📝 `src/types/UiaTextRangeBase.hpp` (+1 -0) 📝 `tools/TestTableWriter/UiaTests.csv` (+24 -24) </details> ### 📄 Description ## Summary of the Pull Request Fixes the 24 failing generated tests. 20 of them were fixed by enforcing the following rule: when moving backwards by word... - a degenerate range moves to the beginning of the word, then to the word behind it. - a non-degenerate range outright moves to the word behind it. The fix was simple: if we're a degenerate range, check if we're at the beginning of the word. If not, move there. Otherwise, move to the word before it. See UiaTextRangeBase.cpp changes for implementation details. Along the way, several misauthored tests were found: - 2 generated tests: - Cause: MS Word considers a line break a word delimiter. We don't use line-wrapping to distinguish two separate words. - `MovementAtExclusiveEnd` backwards word movement tests: - `end` will always be `writeTarget` because... - [degenerate range case] both `start` and `end` are moved to the beginning of the word (`writeTarget`) - [non-degenerate range case] from the `UiaTextRangeBase` bugfix, we should be moving to the word behind it. - this misauthored test was explicitly found by fixing the bug first explained here. ## References #10925 Word navigation testing --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
claunia added the pull-request label 2026-01-31 09:28:46 +00:00
Sign in to join this conversation.
No Label pull-request
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/terminal#28476