mirror of
https://github.com/microsoft/PowerToys.git
synced 2026-04-05 10:46:33 +02:00
Support device names with underscores (such as 'Default_Monitor') in JSONHelpers.isValidDeviceId (#1826)
* #1821 Support device names with underscores (such as 'Default_Monitor') in JSONHelpers.isValidDeviceId * Make support for '#' in device names optional * Add more unit tests for isValidDeviceId
This commit is contained in:
@@ -84,6 +84,24 @@ namespace FancyZonesUnitTests
|
||||
Assert::IsTrue(isValidDeviceId(deviceId));
|
||||
}
|
||||
|
||||
TEST_METHOD (DeviceIdWithoutHashInName)
|
||||
{
|
||||
const auto deviceId = L"LOCALDISPLAY_5120_1440_{00000000-0000-0000-0000-000000000000}";
|
||||
Assert::IsTrue(isValidDeviceId(deviceId));
|
||||
}
|
||||
|
||||
TEST_METHOD (DeviceIdWithoutHashInNameButWithUnderscores)
|
||||
{
|
||||
const auto deviceId = L"LOCAL_DISPLAY_5120_1440_{00000000-0000-0000-0000-000000000000}";
|
||||
Assert::IsFalse(isValidDeviceId(deviceId));
|
||||
}
|
||||
|
||||
TEST_METHOD (DeviceIdWithUnderscoresInName)
|
||||
{
|
||||
const auto deviceId = L"Default_Monitor#1&1f0c3c2f&0&UID256_5120_1440_{00000000-0000-0000-0000-000000000000}";
|
||||
Assert::IsTrue(isValidDeviceId(deviceId));
|
||||
}
|
||||
|
||||
TEST_METHOD (DeviceIdInvalidFormat)
|
||||
{
|
||||
const auto deviceId = L"_1920_1200_{39B25DD2-130D-4B5D-8851-4791D66B1539}";
|
||||
|
||||
Reference in New Issue
Block a user