Compare two arguments with the comparison function and return Result.success if the function return true.
Compare two arguments with the comparison function and return Result.success if the function return true. Otherwise, it returns Result.failure with the Log containing the argument values.
val a1 = "abc" val a2 = "xyz" Result.diff(a1, a2)(_ == _) // Result.failure > === Failed === > --- lhs --- > abc > --- rhs --- > xyz Result.diff(123, 123)(_ != _).log("It must be different.") // Result.failure > === Failed === > --- lhs --- > 123 > --- rhs --- > 123 > It must be different. val x = 'z' val y = 100 Result.diff(x, y)((x, y) => y < 87 && x <= 'r') // Result.failure > === Failed === > --- lhs --- > z > --- rhs --- > 100
val a1 = "abc" val a2 = "abc" Result.diff(a1, a2)(_ == _) // Result.success Result.diff(123, 456)(_ != _).log("It must be different.") // Result.success val x = 'q' val y = 80 Result.diff(x, y)((x, y) => y < 87 && x <= 'r') // Result.success
https://github.com/hedgehogqa/haskell-hedgehog/blob/921e4af72a181f01d90816fd7055b823bf885b3b/hedgehog/src/Hedgehog/Internal/Property.hs#L707