Skip to content
This repository was archived by the owner on Jan 24, 2025. It is now read-only.
This repository was archived by the owner on Jan 24, 2025. It is now read-only.

Trailing whitespace is ignored #422

@kubukoz

Description

@kubukoz

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions