1
0
mirror of https://github.com/ppy/osu.git synced 2024-09-21 18:47:27 +08:00

Add failing test case

This commit is contained in:
Salman Ahmed 2024-01-10 17:15:27 +03:00
parent a4c9e9f84d
commit 84f704a6c2
2 changed files with 22 additions and 0 deletions

View File

@ -0,0 +1,3 @@
[Mania]
Keys: 4
ColumnLineWidth: 3,,3,3,3

View File

@ -114,5 +114,24 @@ namespace osu.Game.Tests.Skins
Assert.That(configs[0].MinimumColumnWidth, Is.EqualTo(16));
}
}
[Test]
public void TestParseArrayWithSomeEmptyElements()
{
var decoder = new LegacyManiaSkinDecoder();
using (var resStream = TestResources.OpenResource("mania-skin-broken-array.ini"))
using (var stream = new LineBufferedReader(resStream))
{
var configs = decoder.Decode(stream);
Assert.That(configs.Count, Is.EqualTo(1));
Assert.That(configs[0].ColumnLineWidth[0], Is.EqualTo(3));
Assert.That(configs[0].ColumnLineWidth[1], Is.EqualTo(0)); // malformed entry, should be parsed as zero
Assert.That(configs[0].ColumnLineWidth[2], Is.EqualTo(3));
Assert.That(configs[0].ColumnLineWidth[3], Is.EqualTo(3));
Assert.That(configs[0].ColumnLineWidth[4], Is.EqualTo(3));
}
}
}
}