Skip to content

Commit 684ccde

Browse files
committed
Report original arg value if it was shrunk.
1 parent ff6da56 commit 684ccde

File tree

1 file changed

+10
-10
lines changed

1 file changed

+10
-10
lines changed

scalatestPlusScalaCheck/src/main/scala/org/scalatestplus/scalacheck/CheckerAsserting.scala

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -322,22 +322,22 @@ object CheckerAsserting extends ExpectationCheckerAsserting {
322322
//
323323
// Passes 0 as verbosity value to prettyArg function.
324324
//
325-
private[scalacheck] def decorateArgToStringValue(arg: Arg[_], prettifier: Prettifier): String =
326-
arg.arg match {
327-
case null => decorateToStringValue(prettifier, arg.arg)
328-
case _: Unit => decorateToStringValue(prettifier, arg.arg)
329-
case _: String => decorateToStringValue(prettifier, arg.arg)
330-
case _: Char => decorateToStringValue(prettifier, arg.arg)
331-
case _: Array[_] => decorateToStringValue(prettifier, arg.arg)
332-
case _ => arg.prettyArg(new Pretty.Params(0))
325+
private[scalacheck] def decorateArgToStringValue[T](arg: T, prettyArg: Pretty, prettifier: Prettifier): String =
326+
arg match {
327+
case null => decorateToStringValue(prettifier, arg)
328+
case _: Unit => decorateToStringValue(prettifier, arg)
329+
case _: String => decorateToStringValue(prettifier, arg)
330+
case _: Char => decorateToStringValue(prettifier, arg)
331+
case _: Array[_] => decorateToStringValue(prettifier, arg)
332+
case _ => prettyArg(new Pretty.Params(0))
333333
}
334334

335335
private[scalacheck] def prettyArgs(args: List[Arg[_]], prettifier: Prettifier) = {
336336
val strs = for((a, i) <- args.zipWithIndex) yield (
337337
" " +
338338
(if (a.label == "") "arg" + i else a.label) +
339-
" = " + decorateArgToStringValue(a, prettifier) + (if (i < args.length - 1) "," else "") +
340-
(if (a.shrinks > 0) " // " + a.shrinks + (if (a.shrinks == 1) " shrink" else " shrinks") else "")
339+
" = " + decorateArgToStringValue(a.arg, a.prettyArg, prettifier) + (if (i < args.length - 1) "," else "") +
340+
(if (a.shrinks > 0) " // " + a.shrinks + (if (a.shrinks == 1) " shrink" else " shrinks") + " (orig: " + decorateArgToStringValue(a.origArg, a.prettyOrigArg, prettifier) + ")" else "")
341341
)
342342
strs.mkString("\n")
343343
}

0 commit comments

Comments
 (0)