Skip to content

Commit

Permalink
Test helpers shouldn't escape quotes by default (#62321)
Browse files Browse the repository at this point in the history
  • Loading branch information
jcouv committed Jul 6, 2022
1 parent cd508c4 commit af92deb
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion src/Compilers/Test/Core/Assert/AssertEx.cs
Original file line number Diff line number Diff line change
Expand Up @@ -555,7 +555,7 @@ public static void AssertEqualToleratingWhitespaceDifferences(
string expected,
string actual,
string message = null,
bool escapeQuotes = true,
bool escapeQuotes = false,
[CallerFilePath] string expectedValueSourcePath = null,
[CallerLineNumber] int expectedValueSourceLine = 0)
{
Expand Down
4 changes: 2 additions & 2 deletions src/Compilers/Test/Core/Compilation/CompilationDifference.cs
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ public void VerifyIL(
[CallerFilePath] string callerPath = null)
{
string actualIL = ILDelta.GetMethodIL();
AssertEx.AssertEqualToleratingWhitespaceDifferences(expectedIL, actualIL, escapeQuotes: true, expectedValueSourcePath: callerPath, expectedValueSourceLine: callerLine);
AssertEx.AssertEqualToleratingWhitespaceDifferences(expectedIL, actualIL, escapeQuotes: false, expectedValueSourcePath: callerPath, expectedValueSourceLine: callerLine);
}

public void VerifyLocalSignature(
Expand Down Expand Up @@ -96,7 +96,7 @@ internal void VerifyIL(
}

string actualIL = ILBuilderVisualizer.ILBuilderToString(ilBuilder, mapLocal ?? ToLocalInfo, sequencePointMarkers);
AssertEx.AssertEqualToleratingWhitespaceDifferences(expectedIL, actualIL, escapeQuotes: true, expectedValueSourcePath: callerPath, expectedValueSourceLine: callerLine);
AssertEx.AssertEqualToleratingWhitespaceDifferences(expectedIL, actualIL, escapeQuotes: false, expectedValueSourcePath: callerPath, expectedValueSourceLine: callerLine);
}

internal string GetMethodIL(string qualifiedMethodName)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ internal static void VerifyIL(
expectedIL = expectedIL.Replace(moduleNamePlaceholder, moduleName);
}

AssertEx.AssertEqualToleratingWhitespaceDifferences(expectedIL, actualIL, escapeQuotes: true, expectedValueSourcePath: expectedValueSourcePath, expectedValueSourceLine: expectedValueSourceLine);
AssertEx.AssertEqualToleratingWhitespaceDifferences(expectedIL, actualIL, escapeQuotes: false, expectedValueSourcePath: expectedValueSourcePath, expectedValueSourceLine: expectedValueSourceLine);
}

internal static ImmutableArray<KeyValuePair<IMethodSymbolInternal, CompilationTestData.MethodData>> GetExplicitlyDeclaredMethods(this CompilationTestData data)
Expand Down
2 changes: 1 addition & 1 deletion src/Compilers/Test/Core/CompilationVerifier.cs
Original file line number Diff line number Diff line change
Expand Up @@ -435,7 +435,7 @@ public CompilationVerifier VerifyIL(
[CallerLineNumber] int callerLine = 0,
string source = null)
{
return VerifyILImpl(qualifiedMethodName, expectedIL, realIL, sequencePoints, callerPath, callerLine, escapeQuotes: true, source: source);
return VerifyILImpl(qualifiedMethodName, expectedIL, realIL, sequencePoints, callerPath, callerLine, escapeQuotes: false, source: source);
}

public void VerifyILMultiple(params string[] qualifiedMethodNamesAndExpectedIL)
Expand Down

0 comments on commit af92deb

Please sign in to comment.