ValueDiffer

trait ValueDiffer[T] extends Differ[T]

Differ where the error diagnostic output is just string values. Simple types where a string representation is enough for diagnostics purposes should use Differ.useEquals (EqualsDiffer is a subtype of this trait). For example, Differ for Int, String, java.time.Instant are all ValueDiffers.

This trait also provide an extra contramap method which makes it easy to write instances for newtypes / opaque types.

trait Differ[T]
class Object
trait Matchable
class Any
class EqualsDiffer[T]
class NumericDiffer[T]
class TransformedDiffer[T, U]

Type members

Types

final override type R = ValueResult

Value members

Abstract methods

override def configureIgnored(newIgnored: Boolean): ValueDiffer[T]
Definition Classes
override def configurePairBy(path: ConfigurePath, op: PairBy[_]): Either[ConfigureError, ValueDiffer[T]]
Definition Classes
override def configurePath(step: String, nextPath: ConfigurePath, op: ConfigureOp): Either[ConfigureError, ValueDiffer[T]]
Definition Classes
override def diff(inputs: DiffInput[T]): R
Definition Classes

Concrete methods

final def contramap[S](transformFunc: S => T): TransformedDiffer[S, T]

Inherited methods

inline def configure[U](inline path: T => U)(configFunc: Differ[U] => Differ[U]): Differ[T]
Inherited from:
ConfigureMethods
final def configureRaw(path: ConfigurePath, operation: ConfigureOp): Either[ConfigureError, Differ[T]]

Attempt to change the configuration of this Differ. If successful, a new differ with the updated configuration will be returned.

Attempt to change the configuration of this Differ. If successful, a new differ with the updated configuration will be returned.

The configuration change can fail due to

  • bad "path" that does not match the internal structure of the Differ
  • The path resolved correctly, but the configuration update operation cannot be applied for that part of the Differ (e.g. wrong type or wrong operation)
Value parameters:
operation

The configuration change operation you want to perform on the target sub-Differ

path

The path to traverse to the sub-Differ

Inherited from:
Differ
final def diff(obtained: T, expected: T): R
Inherited from:
Differ
def ignore: Differ[T]
Inherited from:
Differ
inline def ignoreAt[U](inline path: T => U): Differ[T]
Inherited from:
ConfigureMethods
inline def replace[U](inline path: T => U)(newDiffer: Differ[U]): Differ[T]
Inherited from:
ConfigureMethods
Inherited from:
Differ

Inherited fields

val requiredShapeMsg: String
Inherited from:
ConfigureMethods