-
Notifications
You must be signed in to change notification settings - Fork 91
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
assertEquals produces unhelpful diff for large values #480
Comments
I was able to override the limit in the following way: package example
import munit.{FunSuite, Printer}
import munit.internal.console.Printers
class FunTest extends FunSuite {
def longPrinter = new Printer {
def print(value: Any, out: StringBuilder, indent: Int): Boolean = false
override def height = 200
}
override def munitPrint(clue: => Any): String = {
clue match {
case message: String => message
case value => Printers.print(value, longPrinter)
}
}
test("assertEquals on long lists") {
val a = (1 to 158).toList
val b = (1 to 158).toList ++ List(159)
assertEquals(a, b)
}
} Probably wouldn't hurt to add documentation around this. |
#640 has probably solved this issue and it can be closed |
Looks like it, we can close if the result is not satisfactory let us know! If it's not in M12 it will be in the RC |
The mentioned PR got merged before M8 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
The
assertEquals
function generally produces a useful diff. But if the size of the objects that are being compared is too large, it produces an output that doesn't say anything useful about the assertion failure.Example test:
output:
The text was updated successfully, but these errors were encountered: