garanti

Garanti is a test runner and matcher library.

Types

Result for a single test assertion.

pub type AssertionResult {
  Pass
  Fail(summary: String, expectations: List(Expectation))
  Timeout
}

Constructors

  • Pass

    The test passed, the assertion(s) was fulfilled.

  • Fail(summary: String, expectations: List(Expectation))

    A failed test with the list of expectations detailing what is not as expected.

  • Timeout

The expectation reported by a matcher as part of the AssertionResult. Used to give semantic meaning to a failure in order to display it more clearly.

pub type Expectation {
  Expected(String)
  Actual(String)
  NotExpected(String)
  Missing(String)
  Extra(String)
  NestedTestFailure(
    summary: String,
    expectations: List(Expectation),
  )
}

Constructors

  • Expected(String)

    The expected value described as a string.

  • Actual(String)

    The actual value described as a string.

  • NotExpected(String)

    The value NOT expected described as a string.

  • Missing(String)

    When something is missing from an expected volume.

  • Extra(String)

    When something is extra for (not expected to be part of) an expected volume.

  • NestedTestFailure(
      summary: String,
      expectations: List(Expectation),
    )

    When using combined matchers nesting tests, this contains the details of one such nested tests.

The different levels of logging output that Garanti generates.

pub type LogLevel {
  Error
  Warning
  Info
  Debug
}

Constructors

  • Error
  • Warning
  • Info
  • Debug

Test did not finish executing within the maximum allowed time slot. The top level structure for any tests is a suite. All tests must belong to ONE suite, there are no free-form tests.

pub type Suite {
  Suite(name: String, tests: List(Test))
  FocusedSuite(name: String, tests: List(Test))
}

Constructors

  • Suite(name: String, tests: List(Test))

    A standard test suite containing tests.

  • FocusedSuite(name: String, tests: List(Test))

    A focused test suite. These take preceedence in the runner. When there are focused suites only the focused suites are run.

pub type SuiteResult {
  SuiteComplete(suite_name: String, results: List(TestResult))
  SuiteCancelled(suite_name: String)
}

Constructors

  • SuiteComplete(suite_name: String, results: List(TestResult))
  • SuiteCancelled(suite_name: String)
pub type Test {
  Test(name: String, run: fn() -> AssertionResult)
}

Constructors

  • Test(name: String, run: fn() -> AssertionResult)

    A standard named tests with a parameter-less function that is the test.

pub type TestResult {
  TestResult(name: String, result: AssertionResult)
}

Constructors

Search Document