Hi, I am following some exercises, and one is about creating a clone of "cat". The problem is with the tests that validate the output. The tests will load a reference file that was created by using the official "cat" command, and then will compare that file content with one created by the rust code.
The problem is, the output seems different(LCRF problems I think, mostly) depending if you run cargo test in windows Powershell, wsl2, pure linux bash, etc. A test that actually pass in ubuntu will fail in wsl/ubuntu
The console output is not really helpful in seeing what is different... It looks identical to me.(this is the output of the "spider" test that compares the output with the reference file)
---- spiders stdout ---- thread 'spiders' panicked at 'Unexpected stdout, failed diff original var ├── original: Don't worry, spiders, | I keep house | casually. ├── diff: └── var as str: Don't worry, spiders, I keep house casually. command=`"K:\\code\\rust\\learningrust\\catr\\target\\debug\\catr.exe" "tests/inputs/spiders.txt"` code=0 stdout="Don\'t worry, spiders,\nI keep house\ncasually.\n" stderr="" ', /rustc/c8dfcfe046a7680554bf4eb612bad840e7631c4b\library\core\src\ops\function.rs:227:5
Running the same test on linux returns a success.
So, is there a way to get the same test results across multiples OS shell?