mirror of
https://github.com/ppy/osu.git
synced 2024-12-14 10:12:54 +08:00
Add test coverage for title query parsing
This commit is contained in:
parent
702266198b
commit
11577d1df0
@ -251,6 +251,18 @@ namespace osu.Game.Tests.NonVisual.Filtering
|
|||||||
Assert.AreEqual("my_fav", filterCriteria.Creator.SearchTerm);
|
Assert.AreEqual("my_fav", filterCriteria.Creator.SearchTerm);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
[Test]
|
||||||
|
public void TestApplyTitleQueries()
|
||||||
|
{
|
||||||
|
const string query = "find me songs with title=\"a certain title\" please";
|
||||||
|
var filterCriteria = new FilterCriteria();
|
||||||
|
FilterQueryParser.ApplyQueries(filterCriteria, query);
|
||||||
|
Assert.AreEqual("find me songs with please", filterCriteria.SearchText.Trim());
|
||||||
|
Assert.AreEqual(5, filterCriteria.SearchTerms.Length);
|
||||||
|
Assert.AreEqual("a certain title", filterCriteria.Title.SearchTerm);
|
||||||
|
Assert.That(filterCriteria.Title.Exact, Is.True);
|
||||||
|
}
|
||||||
|
|
||||||
[Test]
|
[Test]
|
||||||
public void TestApplyArtistQueries()
|
public void TestApplyArtistQueries()
|
||||||
{
|
{
|
||||||
|
Loading…
Reference in New Issue
Block a user