Request: Publish internal difflib as a micro-library
Munit's internal difflib is based on a myers diff algorithm to compare strings.
This produces nice user-friendly diffs, even for large multi-line strings.
It would be great to publish it as a separate library so that it can be used with other testing frameworks. For instance, it could be used alongside weaver without needing to pull in the rest of munit:
libraryDependencies += Seq(
"org.scalameta" %% "munit-diff" % "munit-version", // only pulls in the difflib
"com.disneystreaming" %% "weaver-cats" % "weaver-version" // weaver as the actual framework
)
What do you think? If this is feasible, I'd be happy to make a PR to achieve it.
Thanks for reporting! We've been actually thinking about it since, we do use it in a number of places including Metals and I think scalafmt (or we would want to use it for Scala Native support).
It could even be a separate library altogether:
"org.scalameta" %% "scala-diff" % "version"
I can create a separate repo for it.
@tgodzik, that would be fantastic! Let me know once you've got the repo at hand and I'll happily help port the code over.
We discussed this issue offline with @tgodzik and we decided to implement scala-diff as a separate sbt module in munit. I'll pick this one