diff --git a/test/Microsoft.AspNetCore.Razor.Evolution.Test/IntegrationTests/RazorIRNodeWriter.cs b/test/Microsoft.AspNetCore.Razor.Evolution.Test/IntegrationTests/RazorIRNodeWriter.cs index 375d582281..a4e2ccf151 100644 --- a/test/Microsoft.AspNetCore.Razor.Evolution.Test/IntegrationTests/RazorIRNodeWriter.cs +++ b/test/Microsoft.AspNetCore.Razor.Evolution.Test/IntegrationTests/RazorIRNodeWriter.cs @@ -1,6 +1,7 @@ // Copyright (c) .NET Foundation. All rights reserved. // Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. +using System; using System.Collections.Generic; using System.IO; using Microsoft.AspNetCore.Razor.Evolution.Intermediate; @@ -155,9 +156,10 @@ namespace Microsoft.AspNetCore.Razor.Evolution.IntegrationTests return; } - // We explicitly escape newlines in node content so that the IR can be compared line-by-line. + // We explicitly escape newlines in node content so that the IR can be compared line-by-line. The escaped + // newline cannot be platform specific so we need to drop the windows \r. // Also, escape our separator so we can search for ` - `to find delimiters. - _writer.Write(content.Replace("\r", "\\r").Replace("\n", "\\n").Replace("-", "\\-")); + _writer.Write(content.Replace("\r", string.Empty).Replace("\n", "\\n").Replace(" - ", "\\-")); } } } diff --git a/test/Microsoft.AspNetCore.Razor.Evolution.Test/TestFiles/IntegrationTests/HtmlAttributeIntegrationTest/HtmlWithConditionalAttribute.ir.txt b/test/Microsoft.AspNetCore.Razor.Evolution.Test/TestFiles/IntegrationTests/HtmlAttributeIntegrationTest/HtmlWithConditionalAttribute.ir.txt index 8ed15041a2..b353920f6b 100644 --- a/test/Microsoft.AspNetCore.Razor.Evolution.Test/TestFiles/IntegrationTests/HtmlAttributeIntegrationTest/HtmlWithConditionalAttribute.ir.txt +++ b/test/Microsoft.AspNetCore.Razor.Evolution.Test/TestFiles/IntegrationTests/HtmlAttributeIntegrationTest/HtmlWithConditionalAttribute.ir.txt @@ -2,9 +2,9 @@ Document - NamespaceDeclaration - - ClassDeclaration - - - - - RazorMethodDeclaration - - - - - - HtmlContent - (0:0,0 [6] ) - \r\n\r\n \n\n \r\n\r\n" + HtmlContent - (38:2,22 [3] ) - />\n\n" diff --git a/test/Microsoft.AspNetCore.Razor.Evolution.Test/TestFiles/IntegrationTests/HtmlAttributeIntegrationTest/HtmlWithDataDashAttribute.ir.txt b/test/Microsoft.AspNetCore.Razor.Evolution.Test/TestFiles/IntegrationTests/HtmlAttributeIntegrationTest/HtmlWithDataDashAttribute.ir.txt index 6f2258bf2f..2ada8eee97 100644 --- a/test/Microsoft.AspNetCore.Razor.Evolution.Test/TestFiles/IntegrationTests/HtmlAttributeIntegrationTest/HtmlWithDataDashAttribute.ir.txt +++ b/test/Microsoft.AspNetCore.Razor.Evolution.Test/TestFiles/IntegrationTests/HtmlAttributeIntegrationTest/HtmlWithDataDashAttribute.ir.txt @@ -2,7 +2,7 @@ Document - NamespaceDeclaration - - ClassDeclaration - - - - - RazorMethodDeclaration - - - - - - HtmlContent - (0:0,0 [6] ) - \r\n\r\n \r\n\r\n" + HtmlContent - (42:2,26 [1] ) - " />\n\n"