IMPORTANT: To view this page as Markdown, append `.md` to the URL (e.g. /docs/manual/basics.md). For the complete Mojo documentation index, see llms.txt.
Skip to main content
Version: 1.0
For the complete Mojo documentation index, see llms.txt. Markdown versions of all pages are available by appending .md to any URL (e.g. /docs/manual/basics.md).

TestResult

struct TestResult

A test result code.

Implemented traits

AnyType, Copyable, Equatable, ImplicitlyCopyable, ImplicitlyDestructible, Movable, Writable

comptime members

FAIL

comptime FAIL = TestResult(1)

The test failed.

PASS

comptime PASS = TestResult(0)

The test passed.

SKIP

comptime SKIP = TestResult(2)

The test was skipped.

Methods

__eq__

__eq__(self, rhs: Self) -> Bool

Compare two test result codes for equality.

Args:

  • rhs (Self): The other test result code to compare against.

Returns:

Bool: True if the result codes are equal, False otherwise.

write_to

write_to(self, mut writer: T)

Write the result code to the writer.

Args:

  • writer (T): The writer to output the result code to.

write_repr_to

write_repr_to(self, mut writer: T)

Write the repr of this test result to a writer.

Args:

  • writer (T): The writer to output to.