nus-cs2113-AY2122S2 / forum

3 stars 2 forks source link

JUnit Test for System.out #57

Closed shxr3f closed 2 years ago

shxr3f commented 2 years ago

image The above image is a test that checks what was printed out on the console when the mentioned method is called. This test case passes on ubuntu os, however there is a need to include a "\r" in front of every "\n" (see image below) when running the tests on windows for the same test to pass. image How do I deal with this issue?

okkhoy commented 2 years ago

Will wait for someone to answer 🙂

jltha commented 2 years ago

You can try replacing \n with System.lineSeparator(). It worked for me.

shxr3f commented 2 years ago

You can try replacing \n with System.lineSeparator(). It worked for me.

Oh right, will try it out thanks!!