-
Notifications
You must be signed in to change notification settings - Fork 0
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
Output on windows doesn't match correctly #10
Comments
My mistake: stdout also fails to match correctly.
fails with
Again, only on windows. |
Just to make sure it wasn't some problem with bash, I've I tried the example use node from your readme. This also fails on windows:
fails with
|
Hi, and thanks for the report. I suspect the issue may concern line breaks. Windows uses Txm internally checks test programs' So if you have a test file authored on Linux (or on Windows with an editor in Linux-line-break mode, possibly automatically detected due to what the file already contains), and the resulting markdown file's tests are then run on Windows, what might happen is each test program outputs Windows line-breaks, while the expected output in the file has Linux line-breaks. Txm compares them, sees that they differ, and the test fails. I think the reason the readme example may be failing is that it was copied from the readme, which uses Linux line-breaks. To confirm, does the readme "simple example" test pass if you create a new file on Windows and manually type in the relevant parts of the file, or otherwise guarantee Windows line-breaks? (I don't have a suitable Windows machine nearby to test on right now.) |
Hi, and thanks for the pointers and the useful utility :) I also suspected line the CRLF line break. I tried normalizing the text by stripping out carriage returns (e.g., using approaches like these) but it didn't help. I have not tried writing the tests in windows, as I also don't have a suitable Windows machine. However, at your suggestion, I have run the file through I did discover one more strange thing: This test fails (only on Windows):
But this test succeeds on all platforms:
Unfortunately, the problem doesn't seem to be isolated to just running things through |
Inspired by issue #10. This makes outputs a little noisier, but adds a lot of clarity in situations with invisible characters, which are typically very hard to understand otherwise.
This issue inspired me to write a new feature to make invisible control characters visible whenever they appear in diffs, using Unicode's Control Pictures block. That feels like it needed to be done anyway, but perhaps it also helps diagnosis here? The change is live on npm, published in |
I'll try this tomorrow! Thanks for the quick feature-add. This seems like it will be quite useful generally! |
Great feature! You were spot on with the CR line endings:
The reason my attempts to remediate weren't working before was that I assumed the |
I think I'm having the same issue. I have a windows machine available and am happy to be a guinea pig. I'm using visual studio and have set the line endings to
|
We are seeing a bit of strange behavior in our CI tests only on windows runners.
Given this minimal example:
The test succeeds on MacOS and Linux (and on my local machine, running Ubuntu) but it fails on windows with
Comparison with stdout works as expected.
The text was updated successfully, but these errors were encountered: