TestHelper.GenerateExampleTests (Anoma v0.25.0)

I generate test cases for all public functions with arity 0 from the given module.

This macro inspects the given module at compile time, retrieves all its public functions with arity 0 (excluding any functions specified in the :skip option and the __struct__/0 function), and generates a test case for each one.

Usage

use TestHelper.GenerateExampleTests, for: EMyModule, skip: [:func1, :func2]

Options

  • :for - (Required) The module from which to retrieve the public functions.
  • :skip - (Optional) A list of function names (as atoms) to exclude from the generated tests.

Notes

  • If a function specified in :skip is not a public function with arity 0 in the module, a compile-time error is raised.