1
0
mirror of https://github.com/ppy/osu.git synced 2024-12-14 10:52:53 +08:00

Avoid test failures

This is a bit of a workaround (I'm pretty sure these tests are not running correctly on appveyor) but I think it will do for now. Cannot repro failures locally at all.
This commit is contained in:
Dean Herbert 2019-08-20 18:13:00 +09:00
parent 78c7170e86
commit 7d668c81fc

View File

@ -60,12 +60,8 @@ namespace osu.Game.Rulesets.Osu.Tests
{
var match = Regex.Match(componentName, "-([0-9]*)");
if (match.Length > 0)
{
var number = int.Parse(match.Groups[1].Value);
if (number < 60)
return base.GetTexture(componentName.Replace($"-{number}", $"-{number % 2}"));
}
if (match.Length > 0 && int.TryParse(match.Groups[1].Value, out var number) && number < 60)
return base.GetTexture(componentName.Replace($"-{number}", $"-{number % 2}"));
}
return base.GetTexture(componentName);