AshGrant.PolicyTest.Result (AshGrant v0.14.1)

Copy Markdown View Source

Represents the result of a single policy test execution.

Fields

  • :test_name - The full name of the test
  • :passed - Whether the test passed (true) or failed (false)
  • :message - Error message if the test failed, nil if passed
  • :duration_us - Execution time in microseconds
  • :module - The module containing this test (optional, set by run_all)

Summary

Functions

Creates a new Result for a failed test.

Creates a new Result for a passed test.

Types

t()

@type t() :: %AshGrant.PolicyTest.Result{
  duration_us: non_neg_integer(),
  message: String.t() | nil,
  module: module() | nil,
  passed: boolean(),
  test_name: String.t()
}

Functions

fail(test_name, message, duration_us)

@spec fail(String.t(), String.t(), non_neg_integer()) :: t()

Creates a new Result for a failed test.

pass(test_name, duration_us)

@spec pass(String.t(), non_neg_integer()) :: t()

Creates a new Result for a passed test.