1
0
mirror of https://github.com/ppy/osu.git synced 2024-12-14 05:32:54 +08:00

Rename MatchMode.{None -> Substring}

This commit is contained in:
Bartłomiej Dach 2023-06-27 21:28:37 +02:00
parent 06654dc618
commit e3d97b37f1
No known key found for this signature in database
2 changed files with 7 additions and 7 deletions

View File

@ -39,13 +39,13 @@ namespace osu.Game.Tests.NonVisual.Filtering
Assert.That(filterCriteria.SearchTerms[1].MatchMode, Is.EqualTo(FilterCriteria.MatchMode.IsolatedPhrase));
Assert.That(filterCriteria.SearchTerms[2].SearchTerm, Is.EqualTo("looking"));
Assert.That(filterCriteria.SearchTerms[2].MatchMode, Is.EqualTo(FilterCriteria.MatchMode.None));
Assert.That(filterCriteria.SearchTerms[2].MatchMode, Is.EqualTo(FilterCriteria.MatchMode.Substring));
Assert.That(filterCriteria.SearchTerms[3].SearchTerm, Is.EqualTo("for"));
Assert.That(filterCriteria.SearchTerms[3].MatchMode, Is.EqualTo(FilterCriteria.MatchMode.None));
Assert.That(filterCriteria.SearchTerms[3].MatchMode, Is.EqualTo(FilterCriteria.MatchMode.Substring));
Assert.That(filterCriteria.SearchTerms[4].SearchTerm, Is.EqualTo("like"));
Assert.That(filterCriteria.SearchTerms[4].MatchMode, Is.EqualTo(FilterCriteria.MatchMode.None));
Assert.That(filterCriteria.SearchTerms[4].MatchMode, Is.EqualTo(FilterCriteria.MatchMode.Substring));
}
/*
@ -272,7 +272,7 @@ namespace osu.Game.Tests.NonVisual.Filtering
Assert.AreEqual("find me songs by please", filterCriteria.SearchText.Trim());
Assert.AreEqual(5, filterCriteria.SearchTerms.Length);
Assert.AreEqual("singer", filterCriteria.Artist.SearchTerm);
Assert.That(filterCriteria.Artist.MatchMode, Is.EqualTo(FilterCriteria.MatchMode.None));
Assert.That(filterCriteria.Artist.MatchMode, Is.EqualTo(FilterCriteria.MatchMode.Substring));
}
[Test]

View File

@ -154,7 +154,7 @@ namespace osu.Game.Screens.Select
switch (MatchMode)
{
default:
case MatchMode.None:
case MatchMode.Substring:
return value.Contains(SearchTerm, StringComparison.InvariantCultureIgnoreCase);
case MatchMode.IsolatedPhrase:
@ -185,7 +185,7 @@ namespace osu.Game.Screens.Select
MatchMode = MatchMode.IsolatedPhrase;
}
else
MatchMode = MatchMode.None;
MatchMode = MatchMode.Substring;
}
}
@ -197,7 +197,7 @@ namespace osu.Game.Screens.Select
/// <summary>
/// Match using a simple "contains" substring match.
/// </summary>
None,
Substring,
/// <summary>
/// Match for the search phrase being isolated by spaces, or at the start or end of the text.