org

scalactic

package scalactic

Source
package.scala
Linear Supertypes
AnyRef, Any
Ordering
  1. Alphabetic
  2. By inheritance
Inherited
  1. scalactic
  2. AnyRef
  3. Any
  1. Hide All
  2. Show all
Learn more about member selection
Visibility
  1. Public
  2. All

Type Members

  1. trait AbstractStringUniformity extends Uniformity[String]

    Convenience base trait for string Uniformitys.

  2. trait Accumulation extends AccumulationLowPriorityImplicits

    Provides mechanisms that enable errors to be accumulated in “accumulating Ors,” Ors whose Bad type is an Every.

  3. trait AccumulationLowPriorityImplicits extends AnyRef

  4. final case class Bad[+B](b: B) extends Or[Nothing, B] with Product with Serializable

    Contains a “bad” value.

  5. trait Bool extends AnyRef

    A trait that represent a rich-featured boolean value, which includes the following members:

  6. abstract class CanEqual[A, B] extends AnyRef

    Abstract class used to enforce type constraints for equality checks.

  7. class Catcher extends AnyRef

    Convenience class for extractors that match and return Throwables based on a type and Boolean condition.

  8. trait Equality[A] extends Equivalence[A]

    Defines a custom way to determine equality for a type when compared with another value of type Any.

  9. trait Equivalence[T] extends AnyRef

    Defines a custom way to determine equality for a type when compared with another value of the same type.

  10. type ErrorMessage = String

    Type alias for String.

    Type alias for String.

  11. sealed abstract class Every[+T] extends PartialFunction[Int, T] with Product with Serializable

    An ordered, immutable, non-empty collection of elements.

  12. trait Explicitly extends AnyRef

    Provides ScalaTest's “explicitly DSL,” which facilitates the explicit specification of an Equality[T] or a Uniformity[T] where Equality[T] is taken implicitly.

  13. case class Fail[E](error: E) extends Validation[E] with Product with Serializable

    Indicates a validation failed, describing the failure with a contained error value.

  14. trait FutureSugar extends AnyRef

    Trait providing an implicit class that adds a validating method to Future, which takes one or more validation functions and returns either the same Future if either the Future had already failed or its value passes all the functions, or ValidationFailedException containing an error message describing the first validation that failed.

  15. final case class Good[+G](g: G) extends Or[G, Nothing] with Product with Serializable

    Contains a “good” value.

  16. trait LowPriorityTypeCheckedConstraint extends TripleEqualsSupport

    Provides an implicit conversion that will be applied only if a higher-priority implicit conversion declared a subtrait is not applicable.

  17. final case class Many[+T](firstElement: T, secondElement: T, otherElements: T*) extends Every[T] with Product with Serializable

    An Every that contains two or more elements.

  18. trait MapEqualityConstraints extends AnyRef

    Provides an implicit method that loosens the equality constraint defined by TypeCheckedTripleEquals or ConversionCheckedTripleEquals for Scala Maps to one that more closely matches Scala's approach to Map equality.

  19. trait NormMethods extends AnyRef

    Provides an implicit conversion that allows norm to be invoked on any value of type T for which an implicit Normalization[T] exists.

  20. trait Normalization[A] extends AnyRef

    Defines a custom way to normalize instances of a type.

  21. trait NormalizingEquality[A] extends Equality[A]

    An Equality[A] implementation that determines the equality of two objects by normalizing one or both objects, then comparing the results using an “after normalization” equality referenced from the afterNormalizationEquality member.

  22. trait NormalizingEquivalence[A] extends Equivalence[A]

    An Equivalence[A] implementation that determines the equality of two objects by normalizing one or both objects, then comparing the results using an “after normalization” Equivalence referenced from the afterNormalizationEquivalence member.

  23. final case class One[+T](loneElement: T) extends Every[T] with Product with Serializable

    An Every that contains exactly one element.

  24. trait OptionSugar extends AnyRef

    Trait providing an implicit class that adds a toOr method to Option, which converts Some to Good, None to Bad.

  25. sealed abstract class Or[+G, +B] extends Product with Serializable

    Represents a value that is one of two possible types, with one type being “good” and the other “bad.

  26. trait Prettifier extends Serializable

    A function that given any object will produce a “pretty” string representation of that object, where “pretty” is in the eye of the implementer.

  27. trait PrettyMethods extends AnyRef

    Provides an implicit conversion that enables pretty to be invoked on any object, to transform that object into a String representation.

  28. case class PrettyPair(left: String, right: String, analysis: Option[String]) extends Product with Serializable

  29. trait Requirements extends AnyRef

    Trait that contains require, and requireState, and requireNonNull methods for checking pre-conditions that give descriptive error messages extracted via a macro.

  30. trait SeqEqualityConstraints extends AnyRef

    Provides an implicit method that loosens the equality constraint defined by TypeCheckedTripleEquals or ConversionCheckedTripleEquals for Scala Seqs to one that more closely matches Scala's approach to Seq equality.

  31. trait SetEqualityConstraints extends AnyRef

    Provides an implicit method that loosens the equality constraint defined by TypeCheckedTripleEquals or ConversionCheckedTripleEquals for Scala Sets to one that more closely matches Scala's approach to Set equality.

  32. final case class Snapshot(name: String, value: Any) extends Product with Serializable

    Case class that stores the name and value of a variable or expression.

  33. final class SnapshotSeq extends IndexedSeq[Snapshot]

    An IndexedSeq[Snapshot] providing toString and lines methods that can be useful for debug and log messages about program state.

  34. trait Snapshots extends AnyRef

    Trait that provides a snap method that takes one or more arguments and results in a SnapshotSeq, whose toString lists the names and values of each argument.

  35. trait StringNormalizations extends AnyRef

    Provides methods that produce Uniformity[String] instances for various ways to normalize strings for equality comparisons.

  36. trait TimesOnInt extends AnyRef

    Trait providing an implicit conversion that adds a times method to Ints that will repeat a given side-effecting operation multiple times.

  37. trait Tolerance extends AnyRef

    Trait containing an implicit conversion that adds a +- method to Numeric types, which enables spreads to be expressed in terms of a pivot and tolerance.

  38. trait TolerantNumerics extends AnyRef

    Provides Equality and Equivalence instances for Numeric types that compare for equality with a given tolerance.

  39. trait TraversableEqualityConstraints extends SeqEqualityConstraints with SetEqualityConstraints with MapEqualityConstraints

    Provides three implicit methods that loosen the equality constraint defined by TypeCheckedTripleEquals for Scala Traversables to one that more closely matches Scala's approach to Traversable equality.

  40. trait TripleEquals extends TripleEqualsSupport

    Provides === and !== operators that return Boolean, delegate the equality determination to an Equality type class, and require no relationship between the types of the two values compared.

  41. trait TripleEqualsSupport extends AnyRef

    Trait that defines abstract methods used to enforce compile-time type constraints for equality comparisons, and defines === and !== operators used by matchers.

  42. trait TrySugar extends AnyRef

    Trait providing an implicit class that adds a toOr method to Try, which converts Success to Good, and Failure to Bad, as well as a validating method, which takes one or more validation functions and returns either the same Try if either the Try had already failed or its value passes all the functions, or ValidationFailedException containing an error message describing the first validation that failed.

  43. trait TypeCheckedTripleEquals extends LowPriorityTypeCheckedConstraint

    Provides === and !== operators that return Boolean, delegate the equality determination to an Equality type class, and require the types of the two values compared to be in a subtype/supertype relationship.

  44. trait Uniformity[A] extends Normalization[A]

    Defines a custom way to normalize instances of a type that can also handle normalization of that type when passed as Any.

  45. sealed trait Validation[+E] extends Product with Serializable

    Represents the result of a validation, either the object Pass if the validation succeeded, else an instance of Fail containing an error value describing the validation failure.

  46. type Chain[+T] = NonEmptyList[T]

    The name org.scalactic.Chain has been deprecated and will be removed in a future version of Scalactic. Please use its new name, org.scalatest.anyvals.NonEmptyList, instead.

    The name org.scalactic.Chain has been deprecated and will be removed in a future version of Scalactic. Please use its new name, org.scalatest.anyvals.NonEmptyList, instead.

    This type has been renamed for consistency with other 'NonEmpty' anyvals.

    Annotations
    @deprecated
    Deprecated

    (Since version 3.1.0) Chain has been deprecated and will be removed in a future version of Scalactic. Please use org.scalactic.anyvals.NonEmptyList instead.

Value Members

  1. object Accumulation extends Accumulation

    Companion object to trait Accumulation that allows Accumulation's members to be imported rather than mixed in, and also contains nested traits used by implicit conversions declared in trait Accumulations.

  2. object Bool

    Bool companion object that provides factory methods to create different sub types of Bool

  3. object Catcher

    Companion object for Catcher that provides a factory method for creating Throwable extractors.

  4. object DefaultEquality

  5. object Equality

    Companion object for trait Equality that provides factory methods for producing Equality instances.

  6. object Equivalence

    Companion object for trait Equivalence that provides a factory method for producing default Equivalence instances.

  7. object Every extends Serializable

    Companion object for abstract class Every.

  8. object Explicitly extends Explicitly

    Companion object for Explicitly, which enables the Scalactic explicitly DSL to be imported rather than mixed in, like this:

  9. object FutureSugar extends FutureSugar

    Companion object for FutureSugar enabling its members to be imported as an alternative to mixing them in.

  10. object Good extends Serializable

    Companion object for Good that offers, in addition to the standard factory method for Good that takes single “good” type, an parameterless apply used to narrow the Good type when creating a Bad.

  11. object MapEqualityConstraints extends MapEqualityConstraints

    Companion object that facilitates the importing of MapEqualityConstraints members as an alternative to mixing it in.

  12. object NormMethods extends NormMethods

    Companion object for NormMethods enabling its members to be imported as an alternative to mixing them in.

  13. object OptionSugar extends OptionSugar

    Companion object for OptionSugar enabling its members to be imported as an alternative to mixing them in.

  14. object Or extends Serializable

    The companion object for Or providing factory methods for creating Ors from Eithers and Trys.

  15. object Pass extends Validation[Nothing] with Product with Serializable

    Indicates a validation succeeded.

  16. object Prettifier extends Serializable

    Companion object for Prettifier that provides a default Prettifier implementation.

  17. object PrettyMethods extends PrettyMethods

    Companion object for trait PrettyMethods enabling its members to be imported as an alternative to mixing them in.

  18. object Requirements extends Requirements

    Companion object that facilitates the importing of Requirements members as an alternative to mixing it in.

  19. val ScalacticVersion: String

    The version number of Scalactic.

    The version number of Scalactic.

    returns

    the Scalactic version number.

  20. object SeqEqualityConstraints extends SeqEqualityConstraints

    Companion object that facilitates the importing of SeqEqualityConstraints members as an alternative to mixing it in.

  21. object SetEqualityConstraints extends SetEqualityConstraints

    Companion object that facilitates the importing of SetEqualityConstraints members as an alternative to mixing it in.

  22. object SnapshotSeq

  23. object Snapshots extends Snapshots

    Companion object that facilitates the importing of Snapshots members as an alternative to mixing it in.

  24. object StringNormalizations extends StringNormalizations

    Companion object to trait StringNormalizations that provides an alternative to mixing it in.

  25. object TimesOnInt extends TimesOnInt

    Companion object that facilitates the importing of TimesOnInt members as an alternative to mixing it in.

  26. object Tolerance extends Tolerance

    Companion object to trait Tolerance that facilitates the importing of Tolerance members as an alternative to mixing it in.

  27. object TolerantNumerics extends TolerantNumerics

    Companion object for TolerantNumerics that enables its members to be imported as an alternative to mixing them in.

  28. object TraversableEqualityConstraints extends TraversableEqualityConstraints

    Companion object that facilitates the importing of TraversableEqualityConstraints members as an alternative to mixing it in.

  29. object TripleEquals extends TripleEquals

    Companion object to trait TripleEquals that facilitates the importing of TripleEquals members as an alternative to mixing it in.

  30. object TripleEqualsSupport

  31. object TrySugar extends TrySugar

    Companion object for TrySugar enabling its members to be imported as an alternative to mixing them in.

  32. object TypeCheckedTripleEquals extends TypeCheckedTripleEquals

    Companion object to trait TypeCheckedTripleEquals that facilitates the importing of TypeCheckedTripleEquals members as an alternative to mixing it in.

  33. package anyvals

  34. def attempt[R](f: ⇒ R): Or[R, Throwable]

    Returns the result of evaluating the given block f, wrapped in a Good, or if an exception is thrown, the Throwable, wrapped in a Bad.

    Returns the result of evaluating the given block f, wrapped in a Good, or if an exception is thrown, the Throwable, wrapped in a Bad.

    Here are some examples:

    scala> import org.scalactic._
    import org.scalactic._
    
    scala> attempt { 2 / 1 }
    res0: org.scalactic.Or[Int,Throwable] = Good(2)
    
    scala> attempt { 2 / 0 }
    res1: org.scalactic.Or[Int,Throwable] = Bad(java.lang.ArithmeticException: / by zero)
    

    f

    the block to attempt to evaluate

    returns

    the result of evaluating the block, wrapped in a Good, or the thrown exception, wrapped in a Bad

  35. package exceptions

  36. package source

Deprecated Value Members

  1. val Chain: NonEmptyList.type

    The name org.scalactic.Chain has been deprecated and will be removed in a future version of Scalactic. Please use its new name, org.scalatest.anyvals.NonEmptyList, instead.

    The name org.scalactic.Chain has been deprecated and will be removed in a future version of Scalactic. Please use its new name, org.scalatest.anyvals.NonEmptyList, instead.

    This type has been renamed for consistency with other 'NonEmpty' anyvals.

    Annotations
    @deprecated
    Deprecated

    (Since version 3.1.0) Chain has been deprecated and will be removed in a future version of Scalactic. Please use org.scalactic.anyvals.NonEmptyList instead.

  2. val End: scalactic.anyvals.End.type

    The name org.scalactic.End has been deprecated and will be removed in a future version of Scalactic. Please use its new name, org.scalatest.anyvals.End, instead.

    The name org.scalactic.End has been deprecated and will be removed in a future version of Scalactic. Please use its new name, org.scalatest.anyvals.End, instead.

    This type has been renamed for consistency with other 'NonEmpty' anyvals.

    Annotations
    @deprecated
    Deprecated

    (Since version 3.1.0) End has been deprecated and will be removed in a future version of Scalactic. Please use org.scalactic.anyvals.End instead.

Inherited from AnyRef

Inherited from Any

Ungrouped