From 312ad1e775eb9f66f96a06b01e0017ca72c00770 Mon Sep 17 00:00:00 2001 From: Fredric Silberberg Date: Mon, 7 Oct 2024 17:56:24 -0700 Subject: [PATCH] Update baselines, skip design time verification where tracked by https://github.com/dotnet/razor/issues/10981. --- .../ComponentPreprocessorDirectiveTest.cs | 12 ++++++++++-- .../EndIfNotOnNewline.diag.txt | 2 +- .../EndIfNotOnNewline.stree.txt | 2 +- 3 files changed, 12 insertions(+), 4 deletions(-) diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/IntegrationTests/ComponentPreprocessorDirectiveTest.cs b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/IntegrationTests/ComponentPreprocessorDirectiveTest.cs index 05f09f712ae..c8c116e3bdd 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/IntegrationTests/ComponentPreprocessorDirectiveTest.cs +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/IntegrationTests/ComponentPreprocessorDirectiveTest.cs @@ -133,7 +133,11 @@ public void AfterTag() """); AssertDocumentNodeMatchesBaseline(generated.CodeDocument); - AssertCSharpDocumentMatchesBaseline(generated.CodeDocument); + if (!DesignTime) + { + // https://github.com/dotnet/razor/issues/10981 + AssertCSharpDocumentMatchesBaseline(generated.CodeDocument); + } CompileToAssembly(generated, // x:\dir\subdir\Test\TestComponent.cshtml(7,1): error CS1028: Unexpected preprocessor directive // #endif @@ -254,7 +258,11 @@ public void StartOfLine_05() """); AssertDocumentNodeMatchesBaseline(generated.CodeDocument); - AssertCSharpDocumentMatchesBaseline(generated.CodeDocument); + if (!DesignTime) + { + // https://github.com/dotnet/razor/issues/10981 + AssertCSharpDocumentMatchesBaseline(generated.CodeDocument); + } CompileToAssembly(generated); } diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/CSharpPreprocessorTest/EndIfNotOnNewline.diag.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/CSharpPreprocessorTest/EndIfNotOnNewline.diag.txt index 16f7c79d6b0..4dac9fa0108 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/CSharpPreprocessorTest/EndIfNotOnNewline.diag.txt +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/CSharpPreprocessorTest/EndIfNotOnNewline.diag.txt @@ -1,2 +1,2 @@ (1,2): Error RZ1006: The code block is missing a closing "}" character. Make sure you have a matching "}" character for all the "{" characters within this block, and that none of the "}" characters are being interpreted as markup. -(0,0): Warning RZ1042: Possible C# preprocessor directive is misplaced. C# preprocessor directives must be at the start of the line, except for whitespace. +(7,4): Warning RZ1042: Possible C# preprocessor directive is misplaced. C# preprocessor directives must be at the start of the line, except for whitespace. diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/CSharpPreprocessorTest/EndIfNotOnNewline.stree.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/CSharpPreprocessorTest/EndIfNotOnNewline.stree.txt index aacee365ee4..7a62e0a4067 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/CSharpPreprocessorTest/EndIfNotOnNewline.stree.txt +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/CSharpPreprocessorTest/EndIfNotOnNewline.stree.txt @@ -13,7 +13,7 @@ CSharpStatementLiteral - [2..64)::62 - [LF#if falseLF}LF
LF

Content

LF
LF@{ #endif }] - Gen NewLine;[LF]; CSharpDirective;[#if falseLF]; - CSharpDisabledText;[}LF
LF

Content

LF
LF@{ #endif }];RZ1042(56:-1,-1 [6] ) + CSharpDisabledText;[}LF
LF

Content

LF
LF@{ #endif }];RZ1042(56:6,3 [6] ) RazorMetaCode - [64..64)::0 - Gen RightBrace;[]; EndOfFile;[];