Define CHECK_THROWS

Define Documentation

CHECK_THROWS(expected, expression)
[source]

Fail if expression does not throw an exception of type expected.

The test fails if expression throws nothing or throws an exception of a different type. Only available when exceptions are enabled (MUTINY_HAVE_EXCEPTIONS is non-zero).

Parameters:
  • expected – Exception type that must be thrown (not a string).

  • expression – Expression that should throw.