Kinda.Testing.NativeScenario (kinda v0.12.0)

Copy Markdown View Source

Runs serializable native-resource scenarios inside an isolated BEAM.

Steps can bind and drop call results, refer to earlier bindings, assert exact or eventually-observed results, hot-upgrade NIF modules, purge old code, and request garbage collection. The data-only form can cross the port boundary used by Kinda.Testing.Isolated.

Summary

Types

native_call()

@type native_call() :: {module(), atom(), [term() | resource_ref()]}

resource_ref()

@type resource_ref() :: {:resource, atom()}

step()

@type step() ::
  {:call, atom(), native_call()}
  | {:call, native_call()}
  | {:drop, atom()}
  | {:expect, term(), native_call()}
  | {:eventually_expect, term(), native_call()}
  | {:upgrade, module(), atom(), String.t()}
  | {:purge, module()}
  | :garbage_collect

Functions

run(steps)

@spec run([step()]) :: :ok