-
Notifications
You must be signed in to change notification settings - Fork 10
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
Inconsistent white space and new line on windows and linux #27
Comments
Hey @sunshine69 ! Thanks for reporting ; I pushed 8d56e4e as an attempted fix but I don't have a windows machine already setup and ready for testing this provider. I'll get that and confirm it works as expected or figure out the right fix in the next days Cheers |
Great, in my automatin-go I got this file with content
The template output are identical for windows and linux now. I am not sure why there is another new line at the end in both cases but the initial problem has been fixed.
Thank you very much for prompt fixes. Highly appreciated it. Kind regards |
Interesting behaviour The above code run same on windows and linux which does not happen before but now fixed on windows. However these
produce inconsistent still On linux it is the same (which is expected as well if option like the first line set correctly But on windows I see
So trimblock option seems to not working on windows correctly? At least I can use the dash to adjust but not sure. |
Hmm seems I have missed some white space handling logic somewhere in the code with my last fix ... no worries, I'll figure it out once I have setup my windows machine and can run tests on it. Bear with me and thanks for the report again 🙇 |
No worries. Normally I adjust white spaces using dash |
Hey @sunshine69 I added b03bd7c and tested that on windows, and it seems to be working just fine for me . You sure you're version of gonja is up to date ? Would you mind testing again on your side 🙏 ?
|
I will start testing now, will update here soon. The previous one already works for both if control white space manually using |
OK I have run as instructed (not understand ginkgo whatever yet lol) and it seems to be passed Ginkgo ran 7 suites in 1m1.9305103s However mine test is still seeing it is not the same as on linux. Might be my code. I will have a look myself. In my library I added the ability to read the config at the first line and it might be broken. If you trusted ginkgo test pass is good please close the ticket. Thanks a lot |
I must be crazy. I could not prove that you BDD test is faulty but I could not make my code works. No matter what; added print debug, dump the config; everything looks fine. Just when rendering on windows the trim block options does nothing. It must be something somewhere mysteriously. I am a bit tired after long work day; so will leave it now as is. |
@sunshine69 Might be related to the go version you are using 🤷 |
I got a crash in line /home/stevek/go/pkg/mod/github.com/nikolalohinski/gonja/[email protected]/exec/renderer.go:64 +0x6e5
Looks we have to check the slice length?
Now not sure why on this machine it happened but not on other at least not yet seeing it. Let me commit it and pull on the work machine for the same test case and see. golang version is latest
|
OK I add a line into the test and it crash. Please have a look at the diff The crash log is bellow
|
Hi there,
I just realize that the same config and template (that is trimblock is true and lstrip block is true, on linux it produces the expected behaviour but on windows it seems to ignore. Not sure if I made anything crazy ...
The template file content is like this
On windows it produces
On linux is expected
The text was updated successfully, but these errors were encountered: