Skip to main content
Log in

Mojo function

assert_is

assert_is[T: StringableIdentifiable](lhs: T, rhs: T, msg: String = "", *, location: Optional[_SourceLocation] = #kgen.none)

Asserts that the input values have the same identity. If they do not then an Error is raised.

Parameters:

  • ​T (StringableIdentifiable): A StringableIdentifiable type.

Args:

  • ​lhs (T): The lhs of the is statement.
  • ​rhs (T): The rhs of the is statement.
  • ​msg (String): The message to be printed if the assertion fails.
  • ​location (Optional[_SourceLocation]): The location of the error (default to the __call_location).

Raises:

An Error with the provided message if assert fails and None otherwise.

Was this page helpful?