Skip to content

customisable pretty-printing #97

@drdozer

Description

@drdozer

Could we have customisable pretty printing for failing assertions? As per our gitter discussion:

trait utest.testSuite {
  type Printer[_]
  def prettyprint[T : Printer](t: T): Iterator[String]

  ...
}

This would then allow things like:

object MyTestSuite extends TestSuite with PPrinter {
  ...
}

where PPrinter is something like:

trait PPrinter {
  self : TestSuite =>

  type Printer = pprint.PPrint
  def prettyprint[T: pprint.PPrint](t: T) = pprint.tokenize(t)
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions