-
Notifications
You must be signed in to change notification settings - Fork 223
Fix tests to work with new TagBlock parsing format. #87
Fix tests to work with new TagBlock parsing format. #87
Conversation
@@ -162,7 +162,7 @@ public void CalculatePaddingForOpenedIf(bool designTime, bool isIndentingWithTab | |||
|
|||
string text = "\r\n<html>\r\n<body>\r\n\t\t@if (true) { \r\n</body>\r\n</html>"; | |||
|
|||
Span span = GenerateSpan(text, SpanKind.Code, 3, "if (true) { \r\n"); | |||
Span span = GenerateSpan(text, SpanKind.Code, 7, "if (true) { \r\n"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
does this test work on Mono? suggest using Environment.NewLine
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why change? THe text explicitly has \r\n, and hence Environment.NewLine is not what we need to use here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
doesn't Razor normalize line endings when generating? if not (and this test works on Mono -- my original question), I agree w/ leaving as-is
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The padding builder utilizes Environment.Newline in its implementation. Therefore in order to ensure consistency/accuracy we should change it here to (this includes changing the string text
)
Not sure whether I missed a few tests covering spacing within begin, end, and self-closing tags. Looks like almost everything tested matches (Did see tests using both single and double-quotes to surround the attribute value. My concern here is optional spacing within parts of the tag.) |
23dada9
to
2eb7591
Compare
9eefbaf
to
ffe3fb7
Compare
Addressed code review comments. Added some uses of the new BlockFactory in the tests. |
Add copyrites |
@@ -0,0 +1,27 @@ | |||
using System; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Needs license header
Looks good overall. Let's talk about the impact of this - #87 (comment) and then |
- These are the fixes to the tests that could not be fixed by altering the core parsing code base. - Most involve adding TagBlock's, breaking out existing markup blocks and altering some AcceptedCharacter formats. - Was able to loosen the restrictions on AcceptedCharacter's to allow the body of html tags to accept any character. #75
6992d12
to
6114d5d
Compare
ffe3fb7
to
acefdf5
Compare
Tag Helpers: Modify parser to create begin/end html tag elements that are ungrouped. #75
These test fixes are here due to the changes in this PR: #86