mirror of
https://github.com/ppy/osu.git
synced 2024-12-14 20:22:55 +08:00
Rename MatchMode.{None -> Substring}
This commit is contained in:
parent
06654dc618
commit
e3d97b37f1
@ -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[1].MatchMode, Is.EqualTo(FilterCriteria.MatchMode.IsolatedPhrase));
|
||||||
|
|
||||||
Assert.That(filterCriteria.SearchTerms[2].SearchTerm, Is.EqualTo("looking"));
|
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].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].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("find me songs by please", filterCriteria.SearchText.Trim());
|
||||||
Assert.AreEqual(5, filterCriteria.SearchTerms.Length);
|
Assert.AreEqual(5, filterCriteria.SearchTerms.Length);
|
||||||
Assert.AreEqual("singer", filterCriteria.Artist.SearchTerm);
|
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]
|
[Test]
|
||||||
|
@ -154,7 +154,7 @@ namespace osu.Game.Screens.Select
|
|||||||
switch (MatchMode)
|
switch (MatchMode)
|
||||||
{
|
{
|
||||||
default:
|
default:
|
||||||
case MatchMode.None:
|
case MatchMode.Substring:
|
||||||
return value.Contains(SearchTerm, StringComparison.InvariantCultureIgnoreCase);
|
return value.Contains(SearchTerm, StringComparison.InvariantCultureIgnoreCase);
|
||||||
|
|
||||||
case MatchMode.IsolatedPhrase:
|
case MatchMode.IsolatedPhrase:
|
||||||
@ -185,7 +185,7 @@ namespace osu.Game.Screens.Select
|
|||||||
MatchMode = MatchMode.IsolatedPhrase;
|
MatchMode = MatchMode.IsolatedPhrase;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
MatchMode = MatchMode.None;
|
MatchMode = MatchMode.Substring;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -197,7 +197,7 @@ namespace osu.Game.Screens.Select
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// Match using a simple "contains" substring match.
|
/// Match using a simple "contains" substring match.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
None,
|
Substring,
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Match for the search phrase being isolated by spaces, or at the start or end of the text.
|
/// Match for the search phrase being isolated by spaces, or at the start or end of the text.
|
||||||
|
Loading…
Reference in New Issue
Block a user