Skip to content

Commit c9ef3ae

Browse files
committed
Formatting
1 parent 832c4c9 commit c9ef3ae

File tree

2 files changed

+50
-52
lines changed

2 files changed

+50
-52
lines changed

GitHubActionsTestLogger.Tests/Utils/TestResultBuilder.cs

+9-10
Original file line numberDiff line numberDiff line change
@@ -5,16 +5,15 @@ namespace GitHubActionsTestLogger.Tests.Utils;
55

66
internal class TestResultBuilder
77
{
8-
private TestResult _testResult =
9-
new(
10-
new TestCase
11-
{
12-
Id = Guid.NewGuid(),
13-
Source = "FakeTests.dll",
14-
FullyQualifiedName = "FakeTests.FakeTest",
15-
DisplayName = "FakeTest",
16-
}
17-
);
8+
private TestResult _testResult = new(
9+
new TestCase
10+
{
11+
Id = Guid.NewGuid(),
12+
Source = "FakeTests.dll",
13+
FullyQualifiedName = "FakeTests.FakeTest",
14+
DisplayName = "FakeTest",
15+
}
16+
);
1817

1918
public TestResultBuilder SetDisplayName(string displayName)
2019
{

GitHubActionsTestLogger/Utils/StackFrame.cs

+41-42
Original file line numberDiff line numberDiff line change
@@ -21,48 +21,47 @@ internal partial class StackFrame
2121
private const string Space = @"[\x20\t]";
2222
private const string NotSpace = @"[^\x20\t]";
2323

24-
private static readonly Regex Pattern =
25-
new(
26-
$$"""
27-
^
28-
{{Space}}*
29-
\w+ {{Space}}+
30-
(?<frame>
31-
(?<type> {{NotSpace}}+ ) \.
32-
(?<method> {{NotSpace}}+? ) {{Space}}*
33-
(?<params> \( ( {{Space}}* \)
34-
| (?<pt> .+?) {{Space}}+ (?<pn> .+?)
35-
(, {{Space}}* (?<pt> .+?) {{Space}}+ (?<pn> .+?) )* \) ) )
36-
( {{Space}}+
37-
( # Microsoft .NET stack traces
38-
\w+ {{Space}}+
39-
(?<file> ( [a-z] \: # Windows rooted path starting with a drive letter
40-
| / ) # Unix rooted path starting with a forward-slash
41-
.+? )
42-
\: \w+ {{Space}}+
43-
(?<line> [0-9]+ ) \p{P}?
44-
| # Mono stack traces
45-
\[0x[0-9a-f]+\] {{Space}}+ \w+ {{Space}}+
46-
<(?<file> [^>]+ )>
47-
:(?<line> [0-9]+ )
48-
)
49-
)?
50-
)
51-
\s*
52-
$
53-
""",
54-
RegexOptions.IgnoreCase
55-
| RegexOptions.Multiline
56-
| RegexOptions.ExplicitCapture
57-
| RegexOptions.CultureInvariant
58-
| RegexOptions.IgnorePatternWhitespace
59-
| RegexOptions.Compiled,
60-
// Cap the evaluation time to make it obvious should the expression
61-
// fall into the "catastrophic backtracking" trap due to over
62-
// generalization.
63-
// https://github.com/atifaziz/StackTraceParser/issues/4
64-
TimeSpan.FromSeconds(5)
65-
);
24+
private static readonly Regex Pattern = new(
25+
$$"""
26+
^
27+
{{Space}}*
28+
\w+ {{Space}}+
29+
(?<frame>
30+
(?<type> {{NotSpace}}+ ) \.
31+
(?<method> {{NotSpace}}+? ) {{Space}}*
32+
(?<params> \( ( {{Space}}* \)
33+
| (?<pt> .+?) {{Space}}+ (?<pn> .+?)
34+
(, {{Space}}* (?<pt> .+?) {{Space}}+ (?<pn> .+?) )* \) ) )
35+
( {{Space}}+
36+
( # Microsoft .NET stack traces
37+
\w+ {{Space}}+
38+
(?<file> ( [a-z] \: # Windows rooted path starting with a drive letter
39+
| / ) # Unix rooted path starting with a forward-slash
40+
.+? )
41+
\: \w+ {{Space}}+
42+
(?<line> [0-9]+ ) \p{P}?
43+
| # Mono stack traces
44+
\[0x[0-9a-f]+\] {{Space}}+ \w+ {{Space}}+
45+
<(?<file> [^>]+ )>
46+
:(?<line> [0-9]+ )
47+
)
48+
)?
49+
)
50+
\s*
51+
$
52+
""",
53+
RegexOptions.IgnoreCase
54+
| RegexOptions.Multiline
55+
| RegexOptions.ExplicitCapture
56+
| RegexOptions.CultureInvariant
57+
| RegexOptions.IgnorePatternWhitespace
58+
| RegexOptions.Compiled,
59+
// Cap the evaluation time to make it obvious should the expression
60+
// fall into the "catastrophic backtracking" trap due to over
61+
// generalization.
62+
// https://github.com/atifaziz/StackTraceParser/issues/4
63+
TimeSpan.FromSeconds(5)
64+
);
6665

6766
public static IEnumerable<StackFrame> ParseMany(string text) =>
6867
from Match m in Pattern.Matches(text)

0 commit comments

Comments
 (0)