Skip to content
This repository was archived by the owner on Dec 19, 2018. It is now read-only.

Fix tests to work with new TagBlock parsing format. #87

Conversation

NTaylorMullen
Copy link
Contributor

These test fixes are here due to the changes in this PR: #86

@@ -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");
Copy link
Member

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

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

Copy link
Contributor

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.

Copy link
Member

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

Copy link
Contributor Author

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)

@dougbu
Copy link
Member

dougbu commented Aug 25, 2014

Not sure whether I missed a few tests covering spacing within begin, end, and self-closing tags. Looks like almost everything tested matches <name>, </name>, and <name attribute='value' />. Should also test at least <name >, </name >, and <name attribute = 'value'/>.

(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.)

@NTaylorMullen NTaylorMullen force-pushed the TagHelpers_TagBlockParsing branch from 23dada9 to 2eb7591 Compare August 25, 2014 22:49
@NTaylorMullen NTaylorMullen force-pushed the TagHelpers_TagBlockParsingTestFixes branch from 9eefbaf to ffe3fb7 Compare August 26, 2014 03:39
@NTaylorMullen
Copy link
Contributor Author

Addressed code review comments. Added some uses of the new BlockFactory in the tests.

@NTaylorMullen
Copy link
Contributor Author

Add copyrites

@@ -0,0 +1,27 @@
using System;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Needs license header

@pranavkm
Copy link
Contributor

Looks good overall. Let's talk about the impact of this - #87 (comment) and then :shipit:

- 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
@NTaylorMullen NTaylorMullen force-pushed the TagHelpers_TagBlockParsing branch from 6992d12 to 6114d5d Compare August 27, 2014 21:15
@NTaylorMullen NTaylorMullen force-pushed the TagHelpers_TagBlockParsingTestFixes branch from ffe3fb7 to acefdf5 Compare August 27, 2014 21:15
@NTaylorMullen NTaylorMullen deleted the TagHelpers_TagBlockParsingTestFixes branch August 27, 2014 21:26
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants