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

Add test coverage for title query parsing

This commit is contained in:
Bartłomiej Dach 2023-06-27 20:41:03 +02:00
parent 702266198b
commit 11577d1df0
No known key found for this signature in database

View File

@ -251,6 +251,18 @@ namespace osu.Game.Tests.NonVisual.Filtering
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]
public void TestApplyArtistQueries()
{