Skip to content

Add 85 C++ MSTest tests for FancyZones#46930

Open
crutkas wants to merge 4 commits intomicrosoft:mainfrom
crutkas:split/fancyzones-tests
Open

Add 85 C++ MSTest tests for FancyZones#46930
crutkas wants to merge 4 commits intomicrosoft:mainfrom
crutkas:split/fancyzones-tests

Conversation

@crutkas
Copy link
Copy Markdown
Member

@crutkas crutkas commented Apr 12, 2026

Summary

85 new TEST_METHODs covering FancyZones:

  • Layout calculations: columns, rows, grid, priority grid, focus
  • Keyboard snap: index-based navigation, position-based, extend selection
  • Data structures: AppliedLayouts, CustomLayouts, LayoutHotkeys JSON parsing
  • Device ID parsing: valid/invalid formats, serial numbers
  • Engine lifecycle: drag start/move/end, cancel, shift-drag

Split from #46905 (1/7) — see that PR for full context.

Files Changed (4)

  • src/modules/fancyzones/FancyZonesTests/UnitTests/FancyZones.Tests.cpp (new)
  • src/modules/fancyzones/FancyZonesTests/UnitTests/UnitTests.vcxproj (modified)
  • src/modules/fancyzones/FancyZonesTests/UnitTests/UnitTests.vcxproj.filters (modified)
  • .github/actions/spell-check/expect.txt (modified)

Layout calculations (columns, rows, grid, priority grid, focus), keyboard snap
(index-based navigation, position-based, extend selection), data structures
(AppliedLayouts, CustomLayouts, LayoutHotkeys JSON parsing), device ID parsing
(valid/invalid formats, serial numbers), and engine lifecycle (drag start/move/end,
cancel, shift-drag).

Split from PR microsoft#46905 (1/7)

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@crutkas crutkas added the Area-Tests issues that relate to tests label Apr 12, 2026
@github-actions

This comment has been minimized.

@crutkas
Copy link
Copy Markdown
Member Author

crutkas commented Apr 12, 2026

/azp run

@crutkas crutkas added the Needs-Review This Pull Request awaits the review of a maintainer. label Apr 12, 2026
@azure-pipelines
Copy link
Copy Markdown

Azure Pipelines successfully started running 1 pipeline(s).

@github-actions

This comment has been minimized.

Copy link
Copy Markdown
Member

@DHowett DHowett left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

An engineer--not a computer--needs to verify each of these test cases to ensure that they are worthwhile and on-target.

- Kept 32 tests with genuine new coverage (ZoneArea, Layout variants,
  ChooseNextZone, PrepareRectForCycling, LayoutConfigurator invariants,
  SnapByPosition 2x2 grid navigation)
- Deleted 12 tests duplicating WorkAreaIdTests.Spec.cpp
- Deleted 15 tests duplicating JsonHelpers.Tests.cpp (GUID, DeviceId, TypeTo/FromString)
- Deleted 4 bitmask tests duplicating Layout.Spec.cpp
- Deleted 3 HexToRGB tests duplicating Util.Spec.cpp
- Deleted 3 MonitorOrdering tests duplicating Util.Spec.cpp
- Deleted 9 hollow SnapByIndex tests and local helper reimplementation
- Deleted 2 misleading LayoutAssignedWindows tests
- Deleted 4 duplicate Layout zero/big-count tests
- Strengthened SnapByPositionRight2x2 and SnapByPositionDown2x2 with exact index assertions
- Strengthened PriorityGrid11Zones with per-zone geometry validation
- Added deep comments (Product code / What / Why / Risk) to all 32 surviving tests
- Removed unused includes (ZoneIndexSetBitmask, JsonHelpers, Settings, etc.)

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@github-actions

This comment has been minimized.

@github-actions
Copy link
Copy Markdown

@check-spelling-bot Report

🔴 Please review

See the 📂 files view, the 📜action log, 👼 SARIF report, or 📝 job summary for details.

Unrecognized words (1)

AAAAs

These words are not needed and should be removed aaaa diu IPREVIEW ITHUMBNAIL LOCALDISPLAY LPCFHOOKPROC LUMA MAXDWORD MRT suntimes timespan VSync xxxx

To accept these unrecognized words as correct and remove the previously acknowledged and now absent words, you could run the following commands

... in a clone of the git@github.com:crutkas/autoUpgradeAttempt.git repository
on the split/fancyzones-tests branch (ℹ️ how do I use this?):

curl -s -S -L 'https://raw.githubusercontent.com/check-spelling/check-spelling/cfb6f7e75bbfc89c71eaa30366d0c166f1bd9c8c/apply.pl' |
perl - 'https://github.com/microsoft/PowerToys/actions/runs/24324978170/attempts/1' &&
git commit -m 'Update check-spelling metadata'
If the flagged items are 🤯 false positives

If items relate to a ...

  • binary file (or some other file you wouldn't want to check at all).

    Please add a file path to the excludes.txt file matching the containing file.

    File paths are Perl 5 Regular Expressions - you can test yours before committing to verify it will match your files.

    ^ refers to the file's path from the root of the repository, so ^README\.md$ would exclude README.md (on whichever branch you're using).

  • well-formed pattern.

    If you can write a pattern that would match it,
    try adding it to the patterns.txt file.

    Patterns are Perl 5 Regular Expressions - you can test yours before committing to verify it will match your lines.

    Note that patterns can't match multiline strings.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Area-Tests issues that relate to tests Needs-Review This Pull Request awaits the review of a maintainer.

Projects

Status: No status

Development

Successfully merging this pull request may close these issues.

2 participants