SIGN IN SIGN UP
microsoft / terminal UNCLAIMED

The new Windows Terminal and the original Windows console host, all in the same place!

0 0 91 C++

Add more settings model unit tests (#20117)

## Summary of the Pull Request
Adds tests to `UnitTests_SettingsModel` to improve coverage. Tests
include:
- `SettingInheritanceFallback`: Settings inherit from user defaults;
unset settings fall back to built-in defaults
- `ClearSettingRestoresInheritance`: `ClearXxx()` removes the value at
the current layer, causing fallback to the parent
- `HasSettingAtSpecificLayer`: `HasXxx() `distinguishes explicitly set
values from inherited ones
- `ModifyProfileSettingAndRoundtrip`: Change a profile setting via
setter and `ToJson()` reflects it
- `ModifyGlobalSettingAndRoundtrip`: Change global settings via setter
and `ToJson()` reflects them
- `ModifyColorSchemeAndRoundtrip`: Change a color scheme property and
the serialized JSON reflects it
- `FixupUserSettingsDetectsChanges`: A clean roundtrip produces
idempotent FixupUserSettings() (returns false)
- `FixupCommandlinePatching`: 4 sub-cases: CMD/PowerShell short names
get patched to full paths, no-op when already clean, custom profiles are
untouched

This also updates `TestCloneInheritanceTree` to verify that `HasXxx()`
and settters that modify the clone don't modify the original.

This is being done in preparation for auto-save to help ensure we don't
have any regressions.

## Validation Steps Performed
✅ Tests pass
✅ Manually reviewed the new tests, they make sense and do add value
(though some are less valuable than others, admittedly)
✅ Sent Copilot on a quest to ensure we're not adding redundant tests. It
did catch a few and remove them fwiw.
C
Carlos Zamora committed
c72600dd4f7d4cce50cec9d64938fe2f408afc9d
Parent: eeb9f7a
Committed by GitHub <noreply@github.com> on 4/29/2026, 5:16:30 PM