Skip to main content
Log in

Mojo function

assert_false

assert_false[T: Boolable, //](val: T, msg: String = String("condition was unexpectedly True"), *, location: Optional[_SourceLocation] = Optional(None))

Asserts that the input value is False and raises an Error if it's not.

Parameters:

  • T (Boolable): The type of the value argument.

Args:

  • val (T): The value to assert to be False.
  • 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.