-
Notifications
You must be signed in to change notification settings - Fork 93
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Update clang analyzer name. Flow converter log verification through J… #1213
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -17,17 +17,12 @@ public static AndConstraint<StringAssertions> BeCrossPlatformEquivalent( | |
{ | ||
Execute.Assertion | ||
.ForCondition( | ||
string.Equals(RemoveLineEndings(expected), RemoveLineEndings(assertion.Subject), StringComparison.OrdinalIgnoreCase) | ||
FileDiffingTests.AreEquivalentSarifLogs<SarifLog>(actualSarif: assertion.Subject, expected) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
This helper is more resilient to whitespace-only differences in test files. Also DRYs things out a bit. |
||
) | ||
.BecauseOf(because, becauseArgs) | ||
.FailWith(TestUtilityResources.BeCrossPlatformEquivalentError); | ||
|
||
return new AndConstraint<StringAssertions>(assertion); | ||
} | ||
|
||
private static string RemoveLineEndings(string input) | ||
{ | ||
return Regex.Replace(input, @"\s+", ""); | ||
} | ||
} | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -198,7 +198,7 @@ protected static string GenerateDiffCommand(string suiteName, string expected, s | |
return fullPath; | ||
} | ||
|
||
protected static bool AreEquivalentSarifLogs<T>(string actualSarif, string expectedSarif, IContractResolver contractResolver = null) | ||
public static bool AreEquivalentSarifLogs<T>(string actualSarif, string expectedSarif, IContractResolver contractResolver = null) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
this helper likely should belong somewhere else, not this base class. but maybe it should stay here, if we end up converting everything to a filediffing-derived test class. we'll keep an eye on it. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. string extension. In reply to: 247995751 [](ancestors = 247995751) |
||
{ | ||
expectedSarif = expectedSarif ?? "{}"; | ||
|
||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Previously, we made manual updates to expected test results flowing through this helper.