-
Notifications
You must be signed in to change notification settings - Fork 200
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Added new tests for the specific regressed scenario. * Allow `@@` sequences. Fixes dotnet/sdk#42730 for now. When we move to the new lexer, these will once again be disallowed; attempting to use runtime compilation will necessitate using the native lexer. * Fixup legacy test baselines
- Loading branch information
Showing
34 changed files
with
391 additions
and
60 deletions.
There are no files selected for viewing
5 changes: 0 additions & 5 deletions
5
...s/ParserTests/CSharpBlockTest/TreatsAtSignsAfterFirstPairAsPartOfCSharpStatement.diag.txt
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
45 changes: 45 additions & 0 deletions
45
...tegrationTests/ComponentDesignTimeCodeGenerationTest/AtAtHandled/TestComponent.codegen.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
// <auto-generated/> | ||
#pragma warning disable 1591 | ||
namespace Test | ||
{ | ||
#line default | ||
using global::System; | ||
using global::System.Collections.Generic; | ||
using global::System.Linq; | ||
using global::System.Threading.Tasks; | ||
using global::Microsoft.AspNetCore.Components; | ||
#line default | ||
#line hidden | ||
#nullable restore | ||
public partial class TestComponent : global::Microsoft.AspNetCore.Components.ComponentBase | ||
#nullable disable | ||
{ | ||
#pragma warning disable 219 | ||
private void __RazorDirectiveTokenHelpers__() { | ||
} | ||
#pragma warning restore 219 | ||
#pragma warning disable 0414 | ||
private static object __o = null; | ||
#pragma warning restore 0414 | ||
#pragma warning disable 1998 | ||
protected override void BuildRenderTree(global::Microsoft.AspNetCore.Components.Rendering.RenderTreeBuilder __builder) | ||
{ | ||
#nullable restore | ||
#line 1 "x:\dir\subdir\Test\TestComponent.cshtml" | ||
var validationMessage = @Html.ValidationMessage("test", "", new { | ||
|
||
#line default | ||
#line hidden | ||
#nullable disable | ||
#nullable restore | ||
#line 1 "x:\dir\subdir\Test\TestComponent.cshtml" | ||
@class = "invalid-feedback" }, "div"); | ||
|
||
#line default | ||
#line hidden | ||
#nullable disable | ||
} | ||
#pragma warning restore 1998 | ||
} | ||
} | ||
#pragma warning restore 1591 |
20 changes: 20 additions & 0 deletions
20
...s/IntegrationTests/ComponentDesignTimeCodeGenerationTest/AtAtHandled/TestComponent.ir.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
Document - | ||
NamespaceDeclaration - - Test | ||
UsingDirective - (3:1,1 [20] ) - global::System | ||
UsingDirective - (26:2,1 [40] ) - global::System.Collections.Generic | ||
UsingDirective - (69:3,1 [25] ) - global::System.Linq | ||
UsingDirective - (97:4,1 [36] ) - global::System.Threading.Tasks | ||
UsingDirective - (136:5,1 [45] ) - global::Microsoft.AspNetCore.Components | ||
ClassDeclaration - - public partial - TestComponent - global::Microsoft.AspNetCore.Components.ComponentBase - | ||
DesignTimeDirective - | ||
CSharpCode - | ||
IntermediateToken - - CSharp - #pragma warning disable 0414 | ||
CSharpCode - | ||
IntermediateToken - - CSharp - private static object __o = null; | ||
CSharpCode - | ||
IntermediateToken - - CSharp - #pragma warning restore 0414 | ||
MethodDeclaration - - protected override - void - BuildRenderTree | ||
CSharpCode - (2:0,2 [67] x:\dir\subdir\Test\TestComponent.cshtml) | ||
LazyIntermediateToken - (2:0,2 [67] x:\dir\subdir\Test\TestComponent.cshtml) - CSharp - var validationMessage = @Html.ValidationMessage("test", "", new { | ||
CSharpCode - (70:0,70 [39] x:\dir\subdir\Test\TestComponent.cshtml) | ||
LazyIntermediateToken - (70:0,70 [39] x:\dir\subdir\Test\TestComponent.cshtml) - CSharp - @class = "invalid-feedback" }, "div"); |
10 changes: 10 additions & 0 deletions
10
...grationTests/ComponentDesignTimeCodeGenerationTest/AtAtHandled/TestComponent.mappings.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
Source Location: (2:0,2 [67] x:\dir\subdir\Test\TestComponent.cshtml) | ||
| var validationMessage = @Html.ValidationMessage("test", "", new { | | ||
Generated Location: (987:28,2 [67] ) | ||
| var validationMessage = @Html.ValidationMessage("test", "", new { | | ||
|
||
Source Location: (70:0,70 [39] x:\dir\subdir\Test\TestComponent.cshtml) | ||
|@class = "invalid-feedback" }, "div"); | | ||
Generated Location: (1246:35,70 [39] ) | ||
|@class = "invalid-feedback" }, "div"); | | ||
|
40 changes: 40 additions & 0 deletions
40
.../IntegrationTests/ComponentRuntimeCodeGenerationTest/AtAtHandled/TestComponent.codegen.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
// <auto-generated/> | ||
#pragma warning disable 1591 | ||
namespace Test | ||
{ | ||
#line default | ||
using global::System; | ||
using global::System.Collections.Generic; | ||
using global::System.Linq; | ||
using global::System.Threading.Tasks; | ||
using global::Microsoft.AspNetCore.Components; | ||
#line default | ||
#line hidden | ||
#nullable restore | ||
public partial class TestComponent : global::Microsoft.AspNetCore.Components.ComponentBase | ||
#nullable disable | ||
{ | ||
#pragma warning disable 1998 | ||
protected override void BuildRenderTree(global::Microsoft.AspNetCore.Components.Rendering.RenderTreeBuilder __builder) | ||
{ | ||
#nullable restore | ||
#line (1,3)-(1,70) "x:\dir\subdir\Test\TestComponent.cshtml" | ||
var validationMessage = @Html.ValidationMessage("test", "", new { | ||
|
||
#line default | ||
#line hidden | ||
#nullable disable | ||
|
||
#nullable restore | ||
#line (1,71)-(1,110) "x:\dir\subdir\Test\TestComponent.cshtml" | ||
@class = "invalid-feedback" }, "div"); | ||
|
||
#line default | ||
#line hidden | ||
#nullable disable | ||
|
||
} | ||
#pragma warning restore 1998 | ||
} | ||
} | ||
#pragma warning restore 1591 |
13 changes: 13 additions & 0 deletions
13
...iles/IntegrationTests/ComponentRuntimeCodeGenerationTest/AtAtHandled/TestComponent.ir.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
Document - | ||
NamespaceDeclaration - - Test | ||
UsingDirective - (3:1,1 [22] ) - global::System | ||
UsingDirective - (26:2,1 [42] ) - global::System.Collections.Generic | ||
UsingDirective - (69:3,1 [27] ) - global::System.Linq | ||
UsingDirective - (97:4,1 [38] ) - global::System.Threading.Tasks | ||
UsingDirective - (136:5,1 [47] ) - global::Microsoft.AspNetCore.Components | ||
ClassDeclaration - - public partial - TestComponent - global::Microsoft.AspNetCore.Components.ComponentBase - | ||
MethodDeclaration - - protected override - void - BuildRenderTree | ||
CSharpCode - (2:0,2 [67] x:\dir\subdir\Test\TestComponent.cshtml) | ||
LazyIntermediateToken - (2:0,2 [67] x:\dir\subdir\Test\TestComponent.cshtml) - CSharp - var validationMessage = @Html.ValidationMessage("test", "", new { | ||
CSharpCode - (70:0,70 [39] x:\dir\subdir\Test\TestComponent.cshtml) | ||
LazyIntermediateToken - (70:0,70 [39] x:\dir\subdir\Test\TestComponent.cshtml) - CSharp - @class = "invalid-feedback" }, "div"); |
10 changes: 10 additions & 0 deletions
10
...ntegrationTests/ComponentRuntimeCodeGenerationTest/AtAtHandled/TestComponent.mappings.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
Source Location: (2:0,2 [67] x:\dir\subdir\Test\TestComponent.cshtml) | ||
| var validationMessage = @Html.ValidationMessage("test", "", new { | | ||
Generated Location: (735:21,0 [67] ) | ||
| var validationMessage = @Html.ValidationMessage("test", "", new { | | ||
|
||
Source Location: (70:0,70 [39] x:\dir\subdir\Test\TestComponent.cshtml) | ||
|@class = "invalid-feedback" }, "div"); | | ||
Generated Location: (939:29,0 [39] ) | ||
|@class = "invalid-feedback" }, "div"); | | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
10 changes: 0 additions & 10 deletions
10
....Razor.Language/test/TestFiles/ParserTests/CSharpBlockTest/EscapedIdentifiers_03.diag.txt
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
9 changes: 9 additions & 0 deletions
9
...azor.Language/test/TestFiles/ParserTests/CSharpBlockTest/EscapedIdentifiers_11.cspans.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
Markup span at (0:0,0 [0] ) - Parent: Markup block at (0:0,0 [118] ) | ||
Code span at (0:0,0 [1] ) - Parent: Statement block at (0:0,0 [118] ) | ||
Transition span at (1:0,1 [1] ) - Parent: Statement block at (1:0,1 [117] ) | ||
MetaCode span at (2:0,2 [1] ) - Parent: Statement block at (1:0,1 [117] ) | ||
Code span at (3:0,3 [74] ) - Parent: Statement block at (1:0,1 [117] ) | ||
Code span at (77:0,77 [1] ) - Parent: Statement block at (1:0,1 [117] ) | ||
Code span at (78:0,78 [39] ) - Parent: Statement block at (1:0,1 [117] ) | ||
MetaCode span at (117:0,117 [1] ) - Parent: Statement block at (1:0,1 [117] ) | ||
Markup span at (118:0,118 [0] ) - Parent: Markup block at (0:0,0 [118] ) |
59 changes: 59 additions & 0 deletions
59
...Razor.Language/test/TestFiles/ParserTests/CSharpBlockTest/EscapedIdentifiers_11.stree.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
RazorDocument - [0..118)::118 - [ @{ var validationMessage = @Html.ValidationMessage(Model.Binding, "", new { @@class = "invalid-feedback" }, "div"); }] | ||
MarkupBlock - [0..118)::118 | ||
MarkupTextLiteral - [0..0)::0 - [] - Gen<Markup> | ||
Marker;[]; | ||
CSharpCodeBlock - [0..118)::118 | ||
CSharpStatementLiteral - [0..1)::1 - [ ] - Gen<Stmt> | ||
Whitespace;[ ]; | ||
CSharpStatement - [1..118)::117 | ||
CSharpTransition - [1..2)::1 - Gen<None> | ||
Transition;[@]; | ||
CSharpStatementBody - [2..118)::116 | ||
RazorMetaCode - [2..3)::1 - Gen<None> | ||
LeftBrace;[{]; | ||
CSharpCodeBlock - [3..117)::114 | ||
CSharpStatementLiteral - [3..77)::74 - [ var validationMessage = @Html.ValidationMessage(Model.Binding, "", new { ] - Gen<Stmt> | ||
Whitespace;[ ]; | ||
Identifier;[var]; | ||
Whitespace;[ ]; | ||
Identifier;[validationMessage]; | ||
Whitespace;[ ]; | ||
Assign;[=]; | ||
Whitespace;[ ]; | ||
Identifier;[@Html]; | ||
Dot;[.]; | ||
Identifier;[ValidationMessage]; | ||
LeftParenthesis;[(]; | ||
Identifier;[Model]; | ||
Dot;[.]; | ||
Identifier;[Binding]; | ||
Comma;[,]; | ||
Whitespace;[ ]; | ||
StringLiteral;[""]; | ||
Comma;[,]; | ||
Whitespace;[ ]; | ||
Keyword;[new]; | ||
Whitespace;[ ]; | ||
LeftBrace;[{]; | ||
Whitespace;[ ]; | ||
CSharpEphemeralTextLiteral - [77..78)::1 - [@] - Gen<Stmt> | ||
Transition;[@]; | ||
CSharpStatementLiteral - [78..117)::39 - [@class = "invalid-feedback" }, "div"); ] - Gen<Stmt> | ||
Identifier;[@class]; | ||
Whitespace;[ ]; | ||
Assign;[=]; | ||
Whitespace;[ ]; | ||
StringLiteral;["invalid-feedback"]; | ||
Whitespace;[ ]; | ||
RightBrace;[}]; | ||
Comma;[,]; | ||
Whitespace;[ ]; | ||
StringLiteral;["div"]; | ||
RightParenthesis;[)]; | ||
Semicolon;[;]; | ||
Whitespace;[ ]; | ||
RazorMetaCode - [117..118)::1 - Gen<None> | ||
RightBrace;[}]; | ||
MarkupTextLiteral - [118..118)::0 - [] - Gen<Markup> | ||
Marker;[]; | ||
EndOfFile;[]; |
6 changes: 6 additions & 0 deletions
6
...azor.Language/test/TestFiles/ParserTests/CSharpBlockTest/EscapedIdentifiers_12.cspans.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
Markup span at (0:0,0 [0] ) - Parent: Markup block at (0:0,0 [10] ) | ||
Transition span at (0:0,0 [1] ) - Parent: Statement block at (0:0,0 [10] ) | ||
MetaCode span at (1:0,1 [1] ) - Parent: Statement block at (0:0,0 [10] ) | ||
Code span at (2:0,2 [6] ) - Parent: Statement block at (0:0,0 [10] ) | ||
Code span at (8:1,4 [1] ) - Parent: Statement block at (0:0,0 [10] ) | ||
Code span at (9:1,5 [1] ) - Parent: Statement block at (0:0,0 [10] ) |
1 change: 1 addition & 0 deletions
1
....Razor.Language/test/TestFiles/ParserTests/CSharpBlockTest/EscapedIdentifiers_12.diag.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
(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. |
Oops, something went wrong.