首页 > 解决方案 > 在scalatest中,如何在测试结果中显示完全差异?

问题描述

当 scalatest 中的相等断言失败时。它通常只显示不同的部分,例如:

"...error;
!I e: F[Arg]
[g invalid because
nonconformant bounds;
[Arg, Nothing]
[A <: __wrapper$1$47213a912399466a973eddce7b3420f4.__wrapper$1$47213a912399466a973eddce7b3420f4.]Bounds.Base, B]
  im..." did not equal "...error;
!I e: F[Arg]
[Bounds.g invalid because
nonconformant bounds;
[Arg, Nothing]
[A <: ]Bounds.Base, B]
  im..."
org.scalatest.exceptions.TestFailedException: "...error;
!I e: F[Arg]
[g invalid because
nonconformant bounds;
[Arg, Nothing]
[A <: __wrapper$1$47213a912399466a973eddce7b3420f4.__wrapper$1$47213a912399466a973eddce7b3420f4.]Bounds.Base, B]
  im..." did not equal "...error;
!I e: F[Arg]
[Bounds.g invalid because
nonconformant bounds;
[Arg, Nothing]
[A <: ]Bounds.Base, B]
  im..."

这份报告中丢失了很多信息。此外,当 IDE 配备差异解析器时,它会错误地显示比较结果。有没有办法在 scalatest 中禁用此功能,因此报告中不会有任何省略号?

标签: scalaunit-testingscalatest

解决方案


推荐阅读