Add failing test

This commit is contained in:
Dan Balasescu 2023-11-28 21:14:34 +09:00
parent 537c9e031d
commit 26855a2c04
No known key found for this signature in database
2 changed files with 51 additions and 0 deletions

View File

@ -15,12 +15,14 @@ using osu.Game.IO;
using osu.Game.Rulesets;
using osu.Game.Rulesets.Catch;
using osu.Game.Rulesets.Catch.Beatmaps;
using osu.Game.Rulesets.Mania;
using osu.Game.Rulesets.Mods;
using osu.Game.Rulesets.Objects;
using osu.Game.Rulesets.Objects.Legacy;
using osu.Game.Rulesets.Objects.Types;
using osu.Game.Rulesets.Osu;
using osu.Game.Rulesets.Osu.Beatmaps;
using osu.Game.Rulesets.Taiko;
using osu.Game.Skinning;
using osu.Game.Tests.Resources;
using osuTK;
@ -1156,5 +1158,35 @@ namespace osu.Game.Tests.Beatmaps.Formats
Assert.That(((IHasComboInformation)playable.HitObjects[17]).ComboIndexWithOffsets, Is.EqualTo(9));
}
}
[Test]
public void TestSliderConversionWithCustomDistance([Values("taiko", "mania")] string rulesetName)
{
using (var resStream = TestResources.OpenResource("custom-slider-length.osu"))
using (var stream = new LineBufferedReader(resStream))
{
Ruleset ruleset;
switch (rulesetName)
{
case "taiko":
ruleset = new TaikoRuleset();
break;
case "mania":
ruleset = new ManiaRuleset();
break;
default:
throw new ArgumentOutOfRangeException(nameof(rulesetName), rulesetName, null);
}
var decoder = Decoder.GetDecoder<Beatmap>(stream);
var working = new TestWorkingBeatmap(decoder.Decode(stream));
IBeatmap beatmap = working.GetPlayableBeatmap(ruleset.RulesetInfo, Array.Empty<Mod>());
Assert.That(beatmap.HitObjects[0].GetEndTime(), Is.EqualTo(3153));
}
}
}
}

View File

@ -0,0 +1,19 @@
osu file format v14
[General]
Mode: 0
[Difficulty]
HPDrainRate:6
CircleSize:7
OverallDifficulty:7
ApproachRate:10
SliderMultiplier:1.7
SliderTickRate:1
[TimingPoints]
29,333.333333333333,4,1,0,100,1,0
29,-10000,4,1,0,100,0,0
[HitObjects]
256,192,29,6,0,P|384:192|384:192,1,159.375