nus-cs2113-AY2021S2 / forum

5 stars 0 forks source link

Regarding encountering an error during running tests in Exercises #14

Open NgManSing opened 3 years ago

NgManSing commented 3 years ago

My computer setup:

Exercise: Create Rectangle objects Expected output: "java.awt.Rectangle[x=0,y=0,width=5,height=10]"

I failed to run the tests althought my actual output is the same as the expected output. image

The IDE keeps reporting that "contents have differences only in line separators".

What am I doing wrongly? :(

ivanchongzhien commented 3 years ago

My IDE showed the same test case failed as yours but it passed on Github.

heyjinwei commented 3 years ago

I'm not sure if it's the right way to correct this issue, but I solved the problem by printing a '\n' character instead of a println.

okkhoy commented 3 years ago

For issues related to line-ending, please use the hack suggested by @heyjinwei; I will announce the same to the class. Can any of you confirm if using System.out.print(,,, + "\n"); passes locally on a Mac/Linux?

okkhoy commented 3 years ago

Same as #15 ?