mirror of
https://github.com/ppy/osu.git
synced 2024-12-13 08:32:57 +08:00
Fix test failure on leap years
This commit is contained in:
parent
d544b4dbf1
commit
caad89a4dd
@ -538,7 +538,7 @@ namespace osu.Game.Tests.NonVisual.Filtering
|
||||
Assert.That(filterCriteria.LastPlayed.Max, Is.Not.Null);
|
||||
// the parser internally references `DateTimeOffset.Now`, so to not make things too annoying for tests, just assume some tolerance
|
||||
// (irrelevant in proportion to the actual filter proscribed).
|
||||
Assert.That(filterCriteria.LastPlayed.Min, Is.EqualTo(DateTimeOffset.Now.AddYears(-1).AddMonths(-6)).Within(TimeSpan.FromSeconds(5)));
|
||||
Assert.That(filterCriteria.LastPlayed.Min, Is.EqualTo(DateTimeOffset.Now.AddMonths(-6).AddYears(-1)).Within(TimeSpan.FromSeconds(5)));
|
||||
Assert.That(filterCriteria.LastPlayed.Max, Is.EqualTo(DateTimeOffset.Now.AddMonths(-3)).Within(TimeSpan.FromSeconds(5)));
|
||||
}
|
||||
|
||||
|
@ -402,19 +402,19 @@ namespace osu.Game.Screens.Select
|
||||
// we'll want to flip the operator, such that `>5d` means "more than five days ago", as in "*before* five days ago",
|
||||
// as intended by the user.
|
||||
case Operator.Less:
|
||||
op = Operator.Greater;
|
||||
break;
|
||||
|
||||
case Operator.LessOrEqual:
|
||||
op = Operator.GreaterOrEqual;
|
||||
break;
|
||||
|
||||
case Operator.LessOrEqual:
|
||||
op = Operator.Greater;
|
||||
break;
|
||||
|
||||
case Operator.Greater:
|
||||
op = Operator.Less;
|
||||
op = Operator.LessOrEqual;
|
||||
break;
|
||||
|
||||
case Operator.GreaterOrEqual:
|
||||
op = Operator.LessOrEqual;
|
||||
op = Operator.Less;
|
||||
break;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user