Skip to content

Commit 1842f77

Browse files
Copilotstephentoub
andcommitted
Use named regex capture groups for readability
Co-authored-by: stephentoub <2642209+stephentoub@users.noreply.github.com>
1 parent e63f5ca commit 1842f77

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

tests/ModelContextProtocol.AspNetCore.Tests/ClientConformanceTests.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -141,10 +141,10 @@ private static bool HasOnlyWarnings(string output, string error)
141141
// "Passed: 2/2, 0 failed, 1 warnings"
142142
// If there are 0 failures but warnings > 0, the test behavior is acceptable.
143143
var combined = output + error;
144-
var match = Regex.Match(combined, @"(\d+) failed, (\d+) warnings");
144+
var match = Regex.Match(combined, @"(?<failed>\d+) failed, (?<warnings>\d+) warnings");
145145
return match.Success
146-
&& match.Groups[1].Value == "0"
147-
&& int.TryParse(match.Groups[2].Value, out var warnings)
146+
&& match.Groups["failed"].Value == "0"
147+
&& int.TryParse(match.Groups["warnings"].Value, out var warnings)
148148
&& warnings > 0;
149149
}
150150
}

0 commit comments

Comments
 (0)