nus-cs2103-AY2425S1 / forum

12 stars 0 forks source link

Unable to match strings in runtest.bat for text art #164

Closed flyingsalsa closed 2 weeks ago

flyingsalsa commented 2 weeks ago

image_2024-09-01_171825364 Why does the FC command in the bat file highlight my text art as differing in the expected and actual file? I copied it from my output and put in the expected text.

it would appear there are some missing spaces in some lines of the expected.txt which are in the Actual.txt but if I copy them over to the expected text they disappear after I run the runtest.bat. Any ideas on how to fix this would be appreciated!

RezwanAhmed123 commented 2 weeks ago

I realised in the expected text file, they seem to trim the trailing spaces when u save the file. One way to fix this would be to format the code for ur printing method and remove any spaces before the line break

public void formatPrint(String string) {
    System.out.println(string + ā€œ\nā€);
}

Instead of

public void formatPrint(String string) {
    System.out.println(string + ā€œ \nā€);
}
damithc commented 2 weeks ago

@flyingsalsa let us know if @RezwanAhmed123's suggestion worked or if the issue still persists.

flyingsalsa commented 2 weeks ago

Ah I just tried it out and it worked! closing now ty

damithc commented 2 weeks ago

Ah I just tried it out and it worked!

šŸŽÆ Bulls eye, @RezwanAhmed123 Nice!