How can I stop IntelliJ IDEA printing an empty new line?

Viewed 150

I am following the Atomic Kotlin course. I have understood the concept and my output is correct, however Intellij IDEA complains that the outputs are different. Even when I copy and paste from the answer. Please see screenshot. incorrect output

I have tried using the print() method instead of println(), but it didn't help.

2 Answers

Go to Settings->Editor->General and uncheck the Ensure an empty line.. property.

see the following screenshot: enter image description here

There is a straightforward workaround on how one can avoid this problem. Changing the AtomicKotlin/Programming Basics/Data Types/Exercise 2/test/output.txt manually to add a new line at the end of the text should fix the test.
I've also found a YouTrack ticket with the problem description. According to it, EduTools 4.2 version release should fix it. Maybe it worth to upvote or comment on the ticket.

Related