From a2cb7cf90b9f2d40c54fb0cec1c99abfdf4e65b5 Mon Sep 17 00:00:00 2001 From: Michael Seibt <36601201+mstv@users.noreply.github.com> Date: Sun, 2 May 2021 11:22:33 +0200 Subject: [PATCH] Use fixed culture en-US in SerializableExceptionTests (#9132) --- .../BugReporter.Tests/SerializableExceptionTests.cs | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) diff --git a/UnitTests/BugReporter.Tests/SerializableExceptionTests.cs b/UnitTests/BugReporter.Tests/SerializableExceptionTests.cs index 43556bb8b..dd1d6be4f 100644 --- a/UnitTests/BugReporter.Tests/SerializableExceptionTests.cs +++ b/UnitTests/BugReporter.Tests/SerializableExceptionTests.cs @@ -12,6 +12,8 @@ using NUnit.Framework; namespace BugReporterTests { [TestFixture] + [SetCulture("en-US")] + [SetUICulture("en-US")] public sealed class SerializableExceptionTests { [MethodImpl(MethodImplOptions.NoInlining)] @@ -72,15 +74,7 @@ namespace BugReporterTests StringBuilder m = new(); foreach (string line in exceptionMessage.Split(new[] { '\n', '\r' }, StringSplitOptions.RemoveEmptyEntries)) { - Match match = Regex.Match(line, @".*(?\sin\s.*)"); - if (match.Success) - { - m.AppendLine(line.Replace(match.Groups["path"].Value, string.Empty)); - } - else - { - m.AppendLine(line); - } + m.AppendLine(Regex.Replace(line, @"^(?.*)(?\sin\s.*)$", "${keep}")); } return m.ToString();