EmptyPrinter
munit.diff.EmptyPrinter
object EmptyPrinter extends Printer
Default printer that does not customize the pretty-printer
Attributes
- Graph
-
- Supertypes
- Self type
-
EmptyPrinter.type
Members list
Value members
Concrete methods
Pretty-print a single value during pretty printing.
Pretty-print a single value during pretty printing.
Returns true if this value has been printed, false if FunSuite should fallback to the default pretty-printer.
Attributes
Inherited methods
Attributes
- Inherited from:
- Printer
Combine two printers into a single printer.
Combine two printers into a single printer.
Order is important : this printer will be tried first, then the other printer. The new Printer's height will be the max of the two printers' heights.
Example use case : define some default printers for some types for all tests, and override it for some tests only.
case class Person(name: String, age: Int, mail: String)
trait MySuites extends FunSuite {
override val printer = Printer.apply {
case Person(name, age, mail) => s"$name:$age:$mail"
case m: SomeOtherCaseClass => m.someCustomToString
}
}
trait CompareMailsOnly extends MySuites {
val mailOnlyPrinter = Printer.apply {
case Person(_, _, mail) => mail
}
override val printer = mailOnlyPrinterPrinter orElse super.printer
}
Attributes
- Inherited from:
- Printer
In this article