softwaremill / diffx

Pretty diffs for scala case classes
Apache License 2.0
342 stars 30 forks source link

Trailing whitespace is ignored #422

Closed kubukoz closed 2 years ago

kubukoz commented 2 years ago

Whitespace at the end of a string seems not to affect the diff result.

.show on such diffs also results in a comparison of seemingly equal strings.

Reproduction:

//> using lib "com.softwaremill.diffx::diffx-core:0.8.1"
import com.softwaremill.diffx.Diff

object demo extends App {
  println(Diff[String].apply("hello", "hello\n").isIdentical)
  println(Diff[String].apply("hello", "hello\n").show())
  println("after")
}

Prints:

true
hello
after