object Result
Linear Supertypes
Ordering
- Alphabetic
- By Inheritance
Inherited
- Result
- AnyRef
- Any
- Hide All
- Show All
Visibility
- Public
- Protected
Value Members
- final def !=(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
- final def ##: Int
- Definition Classes
- AnyRef → Any
- final def ==(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
- def all(l: List[Result]): Result
- def any(l: List[Result]): Result
The seed is a bare
Failure(Nil)rather thanResult.failureso that an empty or an all-successfulanydoes not pick up a source location of its own. - final def asInstanceOf[T0]: T0
- Definition Classes
- Any
- def assert(b: Boolean)(implicit pos: SourcePos): Result
- def clone(): AnyRef
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.CloneNotSupportedException]) @IntrinsicCandidate() @native()
- def diff[A, B](a: A, b: B)(f: (A, B) => Boolean)(implicit pos: SourcePos): Result
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 = "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
, val a1 = "abc" val a2 = "xyz" Result.diff(a1, a2)(_ == _) // Result.failure > src/test/scala/MySpec.scala:12 > at MySpec.myTest(MySpec.scala:12) > === Failed === > --- lhs --- > abc > --- rhs --- > xyz Result.diff(123, 123)(_ != _).log("It must be different.") // Result.failure > src/test/scala/MySpec.scala:18 > at MySpec.myTest(MySpec.scala:18) > === 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 > src/test/scala/MySpec.scala:27 > at MySpec.myTest(MySpec.scala:27) > === Failed === > --- lhs --- > z > --- rhs --- > 100
- See also
https://github.com/hedgehogqa/haskell-hedgehog/blob/921e4af72a181f01d90816fd7055b823bf885b3b/hedgehog/src/Hedgehog/Internal/Property.hs#L707
Examples: - def diffNamed[A, B](logName: String, a: A, b: B)(f: (A, B) => Boolean)(implicit pos: SourcePos): Result
- final def eq(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
- def equals(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef → Any
- def error(e: Exception): Result
Unlike the other failure constructors this does not record a source location, because the exception already carries its own stack trace.
- def failure(implicit pos: SourcePos): Result
- final def getClass(): Class[_ <: AnyRef]
- Definition Classes
- AnyRef → Any
- Annotations
- @IntrinsicCandidate() @native()
- def hashCode(): Int
- Definition Classes
- AnyRef → Any
- Annotations
- @IntrinsicCandidate() @native()
- final def isInstanceOf[T0]: Boolean
- Definition Classes
- Any
- final def ne(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
- final def notify(): Unit
- Definition Classes
- AnyRef
- Annotations
- @IntrinsicCandidate() @native()
- final def notifyAll(): Unit
- Definition Classes
- AnyRef
- Annotations
- @IntrinsicCandidate() @native()
- def success: Result
- final def synchronized[T0](arg0: => T0): T0
- Definition Classes
- AnyRef
- def toString(): String
- Definition Classes
- AnyRef → Any
- final def wait(arg0: Long, arg1: Int): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException])
- final def wait(arg0: Long): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException]) @native()
- final def wait(): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException])
- case object Success extends Result with Product with Serializable
Deprecated Value Members
- def finalize(): Unit
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.Throwable]) @Deprecated
- Deprecated
(Since version 9)