-
Notifications
You must be signed in to change notification settings - Fork 528
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
add test cases for sass and include necessary sass test files #743
add test cases for sass and include necessary sass test files #743
Conversation
DCO 1.1 Signed-off-by: Saptarshi Dutta <saptarshidutta31@yahoo.co.in>
Thanks @saptar one of the tests here is failing. We'll have to investigate it. |
FWIW the test that fails on appveyor is fine when run locally on my machine, tested with node v4 v5 & v6 |
@ackl are you on windows using CRLF line endings? Appveyor is testing that scenario. |
@DanPurdy I converted to CRLF in the relevant sass file The test is expecting end of block column to be column 32, but due to CRLF line ending it returns 33 on windows (lib/ruleToggler L:21). I'm guessing this should be fixed in gonzales? I can reproduce similar issue:
|
Yep, as assumed 😭 I'll take a look at gonzales again, thought i'd fixed all the CRLF issues.. It puzzles me looking at that though why we don't see the same issue in scss format. Let me double check because I assume the '\r\n' is counting as 2 columns length throughout gonzales when it should probably only be 1 (being a newline character) Thanks for taking the time to look further into it @ackl If anyone is interested the CRLF / LF checks are here https://github.com/tonyganch/gonzales-pe/blob/dev/src/sass/tokenizer.js#L345 It may not be related as I had tests to check column counts in gonzales but It's definitely worth a look. |
Did some more digging around, I have a feeling this stems from the way gonzales handles the end of BlockType Nodes. The ruleToggler tests use the
(lib/ruleToggler.js L:74) Note the Thus CRLF after the closing brace on a block in scss files does not adversely affect the I guess for sass files, with no closing brace to indicate the end of a BlockType Node, gonzales will take the end of line as the end of the block thus including the \r\n chars? heres some code to illustrate what I mean:
scssASTwith dos line endings
with unix line ending
scssAST traverse to comment Node
sassASTwith dos line endings
with unix line endings
sassAST traverse to comment Node
logs with unix line endings
hope this helps |
Hi @glen-84 I just haven't had any time recently i'm afraid. I will get round to this shortly though! |
Right going to merge this into the disable-linters branch and look into the problem as soon as possible. |
This PR is an extension to PR #723 which is already merged.
This PR brings in additional tests to cover .sass syntax.
Tries to Resolve issue #70
DCO 1.1 Signed-off-by: Saptarshi Dutta saptarshidutta31@yahoo.co.in