Skip to content
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions core/shared/src/main/scala/org/scalacheck/util/Pretty.scala
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ package org.scalacheck.util
import org.scalacheck.Prop.Arg
import org.scalacheck.Test
import scala.annotation.tailrec
import scala.math.round

sealed trait Pretty extends Serializable {
def apply(prms: Pretty.Params): String
Expand Down Expand Up @@ -143,12 +142,13 @@ object Pretty {
implicit def prettyFreqMap(fm: FreqMap[Set[Any]]): Pretty = Pretty { _ =>
if(fm.total == 0) ""
else {
val precision = if (fm.total <= 100) 0 else if (fm.total <= 1000) 1 else 2
"> Collected test data: " / {
for {
(xs,r) <- fm.getRatios
ys = xs - (())
if !ys.isEmpty
} yield round(r*100).toString + "% " + ys.mkString(", ")
} yield s"%.${precision}f".format(r * 100) + "% " + ys.mkString(", ")
}.mkString("\n")
}
}
Expand Down