Add failing source filter query test

This commit is contained in:
Joseph Madamba 2024-11-15 22:51:36 -08:00
parent c2b08beae8
commit 7c94973d4a
No known key found for this signature in database
GPG Key ID: 8B746C7BDDF0BD76

View File

@ -501,6 +501,16 @@ namespace osu.Game.Tests.NonVisual.Filtering
Assert.That(visibleBeatmaps, Is.EqualTo(expectedBeatmapIndexes));
}
[Test]
public void TestApplySourceQueries()
{
const string query = "find me songs with source=\"unit tests\" 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);
}
private class CustomFilterCriteria : IRulesetFilterCriteria
{
public string? CustomValue { get; set; }