mirror of
https://github.com/ppy/osu.git
synced 2024-11-13 16:13:34 +08:00
Add failing test case
This commit is contained in:
parent
a4c9e9f84d
commit
84f704a6c2
3
osu.Game.Tests/Resources/mania-skin-broken-array.ini
Normal file
3
osu.Game.Tests/Resources/mania-skin-broken-array.ini
Normal file
@ -0,0 +1,3 @@
|
||||
[Mania]
|
||||
Keys: 4
|
||||
ColumnLineWidth: 3,,3,3,3
|
@ -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));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user