Skip to content

Commit

Permalink
Merge pull request #4785 from Youssef1313/fix-win-only-tests
Browse files Browse the repository at this point in the history
Fix Windows-only tests
  • Loading branch information
mavasani authored Feb 16, 2021
2 parents bf1bfab + 169ba3d commit ea2e171
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ public override void Initialize(AnalysisContext context) {{ }}
await VerifyCSharpAsync(source, shippedText, unshippedText);
}

[WindowsOnlyFact]
[Fact]
public async Task TestCodeFixToEnableAnalyzerReleaseTracking()
{
var source = @"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -335,8 +335,7 @@ private static string FormatLiteralValues(IEnumerable<string> literalValues)
{
// sanitize the literal to ensure it's not multi-line
// replace any newline characters with a space
var sanitizedLiteral = literal.Replace(Environment.NewLine, " ");
sanitizedLiteral = sanitizedLiteral.Replace((char)13, ' ');
var sanitizedLiteral = literal.Replace((char)13, ' ');
sanitizedLiteral = sanitizedLiteral.Replace((char)10, ' ');

if (literals.Length > 0)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,7 @@ End Class
");
}

[WindowsOnlyFact]
[Fact]
public async Task ParameterWithLocalizableAttribute_MultipleLineStringLiteralArgument_Method_Diagnostic()
{
await VerifyCS.VerifyAnalyzerAsync(@"
Expand All @@ -206,7 +206,7 @@ public void M1(C c)
}
".NormalizeLineEndings(),
// Test0.cs(16,13): warning CA1303: Method 'void Test.M1(C c)' passes a literal string as parameter 'param' of a call to 'void C.M(string param)'. Retrieve the following string(s) from a resource table instead: "a a".
GetCSharpResultAt(16, 13, "void Test.M1(C c)", "param", "void C.M(string param)", "a a"));
GetCSharpResultAt(16, 13, "void Test.M1(C c)", "param", "void C.M(string param)", "a a"));

await VerifyVB.VerifyAnalyzerAsync(@"
Imports Microsoft.VisualBasic
Expand All @@ -225,7 +225,7 @@ End Sub
End Class
".NormalizeLineEndings(),
// Test0.vb(13,13): warning CA1303: Method 'Sub Test.M1(c As C)' passes a literal string as parameter 'param' of a call to 'Sub C.M(param As String)'. Retrieve the following string(s) from a resource table instead: "a a".
GetBasicResultAt(13, 13, "Sub Test.M1(c As C)", "param", "Sub C.M(param As String)", "a a"));
GetBasicResultAt(13, 13, "Sub Test.M1(c As C)", "param", "Sub C.M(param As String)", "a a"));
}

[Fact]
Expand Down Expand Up @@ -1793,7 +1793,7 @@ public void M1()
await csharpTest.RunAsync();
}

[WindowsOnlyTheory]
[Theory]
[InlineData(null)]
[InlineData(PointsToAnalysisKind.None)]
[InlineData(PointsToAnalysisKind.PartialWithoutTrackingFieldsAndProperties)]
Expand Down Expand Up @@ -1834,7 +1834,7 @@ public void M1(C c)
{
csTest.ExpectedDiagnostics.Add(
// Test0.cs(17,13): warning CA1303: Method 'void Test.M1(C c)' passes a literal string as parameter 'param' of a call to 'void C.M(string param)'. Retrieve the following string(s) from a resource table instead: "a a".
GetCSharpResultAt(17, 13, "void Test.M1(C c)", "param", "void C.M(string param)", "a a"));
GetCSharpResultAt(17, 13, "void Test.M1(C c)", "param", "void C.M(string param)", "a a"));
}

await csTest.RunAsync();
Expand Down Expand Up @@ -1866,7 +1866,7 @@ End Class
{
vbTest.ExpectedDiagnostics.Add(
// Test0.vb(14,13): warning CA1303: Method 'Sub Test.M1(c As C)' passes a literal string as parameter 'param' of a call to 'Sub C.M(param As String)'. Retrieve the following string(s) from a resource table instead: "a a".
GetBasicResultAt(14, 13, "Sub Test.M1(c As C)", "param", "Sub C.M(param As String)", "a a"));
GetBasicResultAt(14, 13, "Sub Test.M1(c As C)", "param", "Sub C.M(param As String)", "a a"));
}

await vbTest.RunAsync();
Expand Down

0 comments on commit ea2e171

Please sign in to comment.