From 69097dc529ebab5abfe9678a6881def67c405b5f Mon Sep 17 00:00:00 2001 From: andy840119 Date: Fri, 29 Apr 2022 22:28:47 +0800 Subject: [PATCH] Add test case for reverse time-tags. --- .../Visual/Sprites/TestSceneKaraokeSpriteText.cs | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/osu.Framework.Font.Tests/Visual/Sprites/TestSceneKaraokeSpriteText.cs b/osu.Framework.Font.Tests/Visual/Sprites/TestSceneKaraokeSpriteText.cs index 88f1766..ed1eb04 100644 --- a/osu.Framework.Font.Tests/Visual/Sprites/TestSceneKaraokeSpriteText.cs +++ b/osu.Framework.Font.Tests/Visual/Sprites/TestSceneKaraokeSpriteText.cs @@ -26,13 +26,16 @@ public TestSceneKaraokeSpriteText() }; } - [TestCase(new[] { "[0,start]:500", "[1,start]:600", "[2,start]:1000", "[3,start]:1500", "[4,start]:2000" }, true)] // Normal time-tag. - [TestCase(new[] { "[0,start]:0", "[0,end]:100", "[1,start]:1000", "[1,end]:1100", "[2,start]:2000", "[2,end]:2100", "[3,start]:3000", "[3,end]:3100", "[4,start]:4000", "[4,end]:4100" }, true)] - [TestCase(new[] { "[-1,start]:0", "[0,start]:500", "[1,end]:600", "[2,start]:1000", "[3,end]:1500", "[4,end]:2000", "[8,end]:2500" }, true)] // Out-of-range time-tag, but it's acceptable now. - [TestCase(new[] { "[0,start]:500" }, true)] // Only one time-tag. - public void TestKaraokeSpriteTextTimeTags(string[] timeTags, bool boo) + [TestCase("Normal", new[] { "[0,start]:500", "[1,start]:600", "[2,start]:1000", "[3,start]:1500", "[4,start]:2000" })] // Normal time-tag. + [TestCase("Normal 2", new[] { "[0,start]:0", "[0,end]:100", "[1,start]:1000", "[1,end]:1100", "[2,start]:2000", "[2,end]:2100", "[3,start]:3000", "[3,end]:3100", "[4,start]:4000", "[4,end]:4100" })] + [TestCase("Out of range", new[] { "[-1,start]:0", "[0,start]:500", "[1,end]:600", "[2,start]:1000", "[3,end]:1500", "[4,end]:2000", "[8,end]:2500" })] // Out-of-range time-tag, but it's acceptable now. + [TestCase("Reverse", new[] { "[4,start]:2000", "[3,start]:1500", "[2,start]:1000", "[1,start]:600", "[0,start]:500" })] // Reverse order. + [TestCase("Reverse index", new[] { "[0,start]:2000", "[1,start]:1500", "[2,start]:1000", "[3,start]:600", "[4,start]:500" })] // Normal time-tag with reverse time(will have reverse effect). + [TestCase("Reverse time", new[] { "[4,start]:500", "[3,start]:600", "[2,start]:1000", "[1,start]:1500", "[0,start]:2000" })] // Reverse time-tag with non-reverse time(will have reverse effect). + [TestCase("One", new[] { "[0,start]:500" })] // Only one time-tag. + public void TestKaraokeSpriteTextTimeTags(string name, string[] timeTags) { - AddStep("Apply time-tags", () => + AddStep($"Apply \"{name}\" time-tags", () => { var startTime = Clock.CurrentTime;