terminal/src/cascadia/LocalTests_SettingsModel
Carlos Zamora b3b648496e
Ensure equality when hashing default args and no args in actions (#10341)
## Summary of the Pull Request
#10297 found a bug in `ActionMap` where the `ToggleCommandPalette` key chord could not be found using `GetKeyBindingForAction`.

This was caused by the following:
- `AddAction`: when adding the action, the `ActionAndArgs` is basically added as `{ToggleCommandPalette, ToggleCommandLineArgs{}}` (Note the default ctor used for the action args)
- `GetKeyBindingForAction`: we're searching for an `ActionAndArgs` structured as `{ToggleCommandPalette, nullptr}`
- Since these are _technically_ two different actions, we are unable to find it.

This issue was fixed by making the `Hash(ActionAndArgs)` function smarter! If the `ActionAndArgs` has no args, but the `ShortcutAction` _supports_ args, generate the args using the default ctor.

By making `Hash()` smarter, everybody benefits from this logic! We can basically now enforce that `ActionAndArgs{ <X>, nullptr } == ActionAndArgs{ <X>, <default_ctor> }`.

## Validation Steps Performed
- Added a test.
- Tested this on #10297's branch and this does fix the bug
2021-06-16 22:43:29 +00:00
..
ColorSchemeTests.cpp Add support for a profile to specify an "unfocused" appearance (#8392) 2021-04-08 22:46:16 +00:00
CommandTests.cpp Introduce ActionMap to Terminal Settings Model (#9621) 2021-05-04 21:50:13 -07:00
DeserializationTests.cpp Introduce ActionMap to Terminal Settings Model (#9621) 2021-05-04 21:50:13 -07:00
JsonTestClass.h Add Serializer to CascadiaSettings (#8018) 2020-11-17 00:37:19 +00:00
KeyBindingsTests.cpp Ensure equality when hashing default args and no args in actions (#10341) 2021-06-16 22:43:29 +00:00
LocalTests_SettingsModel.def Introduce TerminalSettingsModel project (#7667) 2020-10-06 09:56:59 -07:00
pch.cpp Introduce TerminalSettingsModel project (#7667) 2020-10-06 09:56:59 -07:00
pch.h Introduce MS.Term.Core.Color to replace W.U.Color for Core/Control/TSM (#9658) 2021-03-30 20:15:49 +00:00
ProfileTests.cpp Create a new page for "Add new profile" in the SUI (#9352) 2021-05-05 04:15:25 +00:00
SerializationTests.cpp Bugfix: serialize iterable commands (#10373) 2021-06-10 18:25:27 +00:00
SettingsModel.LocalTests.vcxproj Upgrade Windows SDK to 19041 (#10118) 2021-05-20 16:04:25 +00:00
TerminalSettingsTests.cpp Introduce ActionMap to Terminal Settings Model (#9621) 2021-05-04 21:50:13 -07:00
TestUtils.h Introduce ActionMap to Terminal Settings Model (#9621) 2021-05-04 21:50:13 -07:00