.. default-domain:: chpl

.. module:: Assert
   :synopsis: Support for simple assert() routines.

Assert
======

Support for simple assert() routines.

In the current implementation, these asserts never become no-ops.  That is,
using them will always incur execution-time checks.

.. note:: All Chapel programs automatically ``use`` this module by default.
          An explicit ``use`` statement is not necessary.


.. function:: proc assert(test: bool)

   
   Assert that a boolean condition is true.  If it is false, prints
   'assert failed' and halts the program.
   
   :arg test: the boolean condition
   :type test: `bool`

.. function:: proc assert(test: bool, args ...?numArgs)

   
   Assert that a boolean condition is true.  If it is false, prints
   'assert failed - ' followed by all subsequent arguments, as though
   printed using :proc:`~IO.write()`.
   
   :arg test: the boolean condition
   :type test: `bool`
   
   :arg args: other arguments to print

