What do Groovy assertions look like with parentheses?
The example on this page only shows Groovy assertion开发者_开发问答s 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)?
The answer is:
assert(a != null), "First parameter must not be null"
精彩评论