# Command: unittest::assert_or_die

NEST HelpDesk | Command Index | NEST Quick Reference

Name:

    unittest::assert_or_die - Check condition and quit with exit code 1 if it fails

Synopsis:

    {condition}	 assert_or_die ->	-
      bool	 assert_or_die ->	-
      {condition} string assert_or_die ->	-
      bool	 string assert_or_die ->	-

Examples:

      /unittest (7378) require
      /unittest using
      {1 1 eq} assert_or_die
      {1 0 eq} (1 != 0) assert_or_die
      {1 /hello add 1 eq} assert_or_die
      endusing

Diagnostics:

      This function will quit nest if condition is false (exit code 1),
      or if the condition raises an error (exit code 2).
      It will print an error message to cerr, too.
      If a string argument is given, it will be included in the message.

Availability:

    SLI-2.0

Author:

    R. Kupper, J. M. Eppler

FirstVersion:

    07/30/2007

SeeAlso:

- unittest::fail_or_die
- unittest::pass_or_die
- assert
- quit

Source:

    /opt/conda/conda-bld/nest_1510212701067/work/nest-2.14.0/lib/sli/unittest.sli

NEST HelpDesk | Command Index | NEST Quick Reference

© 2004 The NEST Initiative