tags:

views:

23

answers:

1

The example on this page only shows Groovy assertions without parentheses.

assert a != null, 'First parameter must not be null'

What would this look like if I wanted to include the parentheses? I presume that this is the closest equivalent to Perl's die() function (print error message and exit in one statement)?

A: 

The answer is:

assert(a != null), "First parameter must not be null"
balor123