mirror of
https://github.com/microsoft/PowerToys.git
synced 2026-04-05 18:57:19 +02:00
Fix for File explorer not showing up and multiple notepads (#3969)
* reverted the dedup code, file explorer shows up but so do duplicates * Fixed file explorer and dedup * Formatting * Added tests for all the cases * Formatting * Tests * take name and exe into consideration while calculating hash * unique primes while calculating hash code
This commit is contained in:
@@ -187,8 +187,6 @@ namespace Wox.Test
|
||||
[TestCase("sql manag", MicrosoftSqlServerManagementStudio, StringMatcher.SearchPrecisionScore.Regular, true)]
|
||||
[TestCase("sql", MicrosoftSqlServerManagementStudio, StringMatcher.SearchPrecisionScore.Regular, true)]
|
||||
[TestCase("sql serv", MicrosoftSqlServerManagementStudio, StringMatcher.SearchPrecisionScore.Regular, true)]
|
||||
[TestCase("sqlserv", MicrosoftSqlServerManagementStudio, StringMatcher.SearchPrecisionScore.Regular, false)]
|
||||
[TestCase("sql servman", MicrosoftSqlServerManagementStudio, StringMatcher.SearchPrecisionScore.Regular, false)]
|
||||
[TestCase("sql serv man", MicrosoftSqlServerManagementStudio, StringMatcher.SearchPrecisionScore.Regular, true)]
|
||||
[TestCase("sql studio", MicrosoftSqlServerManagementStudio, StringMatcher.SearchPrecisionScore.Regular, true)]
|
||||
[TestCase("mic", MicrosoftSqlServerManagementStudio, StringMatcher.SearchPrecisionScore.Regular, true)]
|
||||
@@ -224,5 +222,20 @@ namespace Wox.Test
|
||||
$"Raw Score: {matchResult.RawScore}{Environment.NewLine}" +
|
||||
$"Precision Score: {(int)expectedPrecisionScore}");
|
||||
}
|
||||
|
||||
[TestCase("Windows Terminal", "Windows_Terminal", "term")]
|
||||
[TestCase("Windows Terminal", "WindowsTerminal", "term")]
|
||||
public void FuzzyMatchingScore_ShouldBeHigher_WhenPreceedingCharacterIsSpace(string firstCompareStr, string secondCompareStr, string query)
|
||||
{
|
||||
// Arrange
|
||||
var matcher = new StringMatcher();
|
||||
|
||||
// Act
|
||||
var firstScore = matcher.FuzzyMatch(query, firstCompareStr).Score;
|
||||
var secondScore = matcher.FuzzyMatch(query, secondCompareStr).Score;
|
||||
|
||||
// Assert
|
||||
Assert.IsTrue(firstScore > secondScore);
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user