Function testUnaryEquivalence

Attempt to find an example input where the pair of given unary functions is not equal. Given an arbitrary of A, an equivalence for B and a pair of functions, check the functions compute the same B given the same A, for numRuns values. Returns a boolean flag indicating equivalence.

  • Type Parameters

    • A
    • B

    Parameters

    • a: Arbitrary<A>

      An arbitrary for the function argument type A.

    • equalsB: Equivalence<B>

      Equivalence for the function return value type B.

    • Optionalparameters: Parameters<A>

    Returns ((self: ((a: A) => B), that: ((a: A) => B)) => boolean)

    True if no counter-example found, else false.

      • (self, that): boolean
      • Parameters

        • self: ((a: A) => B)

          First function to sample.

            • (a): B
            • Parameters

              Returns B

        • that: ((a: A) => B)

          Second function to sample.

            • (a): B
            • Parameters

              Returns B

        Returns boolean