AB.CompareRunner (AB v0.2.1)

View Source

Executes comparison tests between two implementations with identical typespecs.

This module handles the runtime execution of comparison tests, verifying that two different implementations of the same function produce identical results when given the same inputs.

Summary

Functions

Runs a comparison test between two functions with the given specs.

Executes the actual comparison check between two functions.

Functions

run_compare_test(module1, function1, module2, function2, arg1, arg2, opts)

@spec run_compare_test(
  module(),
  atom(),
  module(),
  atom(),
  {[any()], any()},
  {[any()], any()},
  keyword()
) :: :ok

Runs a comparison test between two functions with the given specs.

Validates that specs match and then runs both functions on the same generated inputs.

run_comparison_check(module1, function1, module2, function2, input_types, output_type, opts)

@spec run_comparison_check(
  module(),
  atom(),
  module(),
  atom(),
  [any()],
  any(),
  keyword()
) :: :ok

Executes the actual comparison check between two functions.

Generates test inputs and verifies both functions produce identical, valid outputs.