From 275fd96b65ae25ef072b2eb1f0a9621ec1f69feb Mon Sep 17 00:00:00 2001 From: andy840119 Date: Wed, 27 Apr 2022 19:25:21 +0800 Subject: [PATCH 1/7] Add helper to process the time-tag string format as test case. --- .../Helper/TestCaseTagHelper.cs | 31 ++++++++++++++++++- 1 file changed, 30 insertions(+), 1 deletion(-) diff --git a/osu.Framework.Font.Tests/Helper/TestCaseTagHelper.cs b/osu.Framework.Font.Tests/Helper/TestCaseTagHelper.cs index 5076971..6637059 100644 --- a/osu.Framework.Font.Tests/Helper/TestCaseTagHelper.cs +++ b/osu.Framework.Font.Tests/Helper/TestCaseTagHelper.cs @@ -2,6 +2,7 @@ // See the LICENCE file in the repository root for full licence text. using System; +using System.Collections.Generic; using System.Linq; using System.Text.RegularExpressions; using osu.Framework.Graphics.Sprites; @@ -41,7 +42,35 @@ public static PositionText ParsePositionText(string str) }; } - public static PositionText[] ParseParsePositionTexts(string[] strings) + /// + /// Process test case time tag string format into + /// + /// + /// [0,start]:1000 + /// + /// Time tag string format + /// Time tag object + public static Tuple ParseTimeTag(string str) + { + if (string.IsNullOrEmpty(str)) + return new Tuple(new TextIndex(), 0); + + var regex = new Regex("(?[-0-9]+),(?start|end)]:(?