assert.jul SCRIPT

Provides assertion functions.

All Definitions


TypeNameSignature
functionassertTruevoid assertTrue(bool, string)
functionassertvoid assert(bool)
functionassertEqualvoid assertEqual(var, var)

Functions


void assertTrue(bool predicate, string msg)

Assert a predicate. On assertion failure, throw System.AssertException.

Parameters

  • predicate The condition to assert. If false, throw System.AssertException.
  • msg A message that will be used in AssertException. throw: System.AssertException When predicate is false.

void assert(bool predicate)

Assert a predicate. On assertion failure, throw System.AssertException.

Parameters

  • predicate The condition to assert. If false, throw System.AssertException. throw: System.AssertException When predicate is false.

void assertEqual(var exp, var act)

Assert that two values are equal. On assertion failure, throw System.AssertException.

Parameters

  • exp The expected value.
  • act The actual value. throw: System.AssertException When the two values are not equal.