terminal/src/interactivity/win32/ut_interactivity_win32
Carlos Zamora c53fe1c2bf
Fix failing UIA movement tests (#10991)
## Summary of the Pull Request
Follow-up for #10886. The new UIA movement tests found some failing cases. This PR fixes UiaTextRangeBase to have movement match that of MS Word. In total, this fixes 64 tests.

## PR Checklist
* [X] Closes #10924
* [X] Tests added/passed

## Detailed Description of the Pull Request / Additional comments
Root causes include...
1. if we were a non-degenerate range and we failed to move, we should still expand to enclose the unit
2. non-degenerate ranges are treated as if they already encompassed their given unit.
   - this one is a bit difficult to explain. Consider these examples:
      1. document movement
         - state: you have a 1-cell wide range on the buffer, and you try to move by document
         - result: move by 0 (there is no next/prev document), but the range now encompasses the entire document
      2. line movement
         - state: you have a 1-cell wide range on a line, and you try to move back by a line
         - result: you go to the previous line (not the beginning of this line)
   - conversely, a degenerate range successfully moves to the beginning/end of the current unit (i.e. document/line)
   - this (bizarre) behavior was confirmed using MS Word

As a bonus, occasionally, Narrator would get stuck when navigating by line. This issue now seems to be fixed.

## Updates to existing tests
- `CanMoveByCharacter`
   - `can't move backward from (0, 0)` --> misauthored, result should be one character wide.
   - `can't move past the last column in the last row` --> misauthored and already covered in generated tests
- `CanMoveByLine`
   - `can't move backward from top row` --> misauthored, end should be on next line. Already covered by generated tests
   - `can't move forward from bottom row` --> misauthored, end should be on next line
   - `can't move backward when part of the top row is in the range` --> misauthored, should expand
   - `can't move forward when part of the bottom row is in the range` --> misauthored, degenerate range moves to end of buffer
- `MovementAtExclusiveEnd`
   - populate the text buffer _before_ we do a move by word operation
   - update to match the now fixed behavior
2021-08-24 13:56:38 +00:00
..
DefaultResource.rc Initial release of the Windows Terminal source code 2019-05-02 15:29:04 -07:00
GeneratedUiaTextRangeMovementTests.g.cpp Fix failing UIA movement tests (#10991) 2021-08-24 13:56:38 +00:00
Interactivity.Win32.UnitTests.vcxproj Link to WinMM.Lib for PlaySound with 19041 (#9624) 2021-03-26 11:35:17 -05:00
Interactivity.Win32.UnitTests.vcxproj.filters Initial release of the Windows Terminal source code 2019-05-02 15:29:04 -07:00
product.pbxproj Initial release of the Windows Terminal source code 2019-05-02 15:29:04 -07:00
sources Merged PR 5445070: [Git2Git] Update the Windows build for some shell changes 2020-12-16 01:32:35 +00:00
testmd.definition Integrate inbox changes up to 68d3b53286dd 2019-12-02 17:24:26 -08:00
UiaTextRangeTests.cpp Fix failing UIA movement tests (#10991) 2021-08-24 13:56:38 +00:00