1
0
mirror of https://github.com/ppy/osu.git synced 2025-01-12 19:42:55 +08:00

Add test coverage for failing slider case

This commit is contained in:
Dean Herbert 2021-10-26 17:35:03 +09:00
parent e92def0ba2
commit aa0762ebe2
2 changed files with 36 additions and 0 deletions

View File

@ -775,5 +775,22 @@ namespace osu.Game.Tests.Beatmaps.Formats
Assert.That(seventh.ControlPoints[4].Type == null);
}
}
[Test]
public void TestSliderLengthExtensionEdgeCase()
{
var decoder = new LegacyBeatmapDecoder { ApplyOffsets = false };
using (var resStream = TestResources.OpenResource("duplicate-last-position-slider.osu"))
using (var stream = new LineBufferedReader(resStream))
{
var decoded = decoder.Decode(stream);
var path = ((IHasPath)decoded.HitObjects[0]).Path;
Assert.That(path.ExpectedDistance.Value, Is.EqualTo(2));
Assert.That(path.Distance, Is.EqualTo(1));
}
}
}
}

View File

@ -0,0 +1,19 @@
osu file format v14
[Difficulty]
HPDrainRate:7
CircleSize:10
OverallDifficulty:9
ApproachRate:10
SliderMultiplier:0.4
SliderTickRate:1
[TimingPoints]
382,923.076923076923,3,2,1,75,1,0
382,-1000,3,2,1,75,0,0
[HitObjects]
// Importantly, the last position is specified twice.
// In this case, osu-stable doesn't extend the slider length even when the "expected" length is higher than the actual.
261,171,25305,6,0,B|262:171|262:171|262:171,1,2,8|0,0:0|0:0,0:0:0:0: