c6f74a948f
Support case-insensitive * and ? matching for persistent process rules and power-plan associations while preserving exact-path behavior.
34 lines
1.0 KiB
C#
34 lines
1.0 KiB
C#
/*
|
|
* ThreadPilot - process power plan association tests.
|
|
*/
|
|
namespace ThreadPilot.Core.Tests
|
|
{
|
|
using ThreadPilot.Models;
|
|
|
|
public sealed class ProcessPowerPlanAssociationTests
|
|
{
|
|
[Fact]
|
|
public void MatchesProcess_WithWildcardPath_MatchesOnlyTargetPath()
|
|
{
|
|
var association = new ProcessPowerPlanAssociation
|
|
{
|
|
IsEnabled = true,
|
|
MatchByPath = true,
|
|
ExecutableName = "node",
|
|
ExecutablePath = @"*Raycast*\backend\node.exe",
|
|
};
|
|
|
|
Assert.True(association.MatchesProcess(new ProcessModel
|
|
{
|
|
Name = "node.exe",
|
|
ExecutablePath = @"C:\Program Files\WindowsApps\Raycast.Raycast_2.5.3.0_x64__publisher\Raycast\backend\NODE.EXE",
|
|
}));
|
|
Assert.False(association.MatchesProcess(new ProcessModel
|
|
{
|
|
Name = "node.exe",
|
|
ExecutablePath = @"C:\nvm4w\nodejs\node.exe",
|
|
}));
|
|
}
|
|
}
|
|
}
|