2010-02-24 11 views
1

this page上的示例僅顯示沒有括號的Groovy斷言。Groovy斷言在括號中是什麼樣的?

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

如果我想包括圓括號,這會是什麼樣子?我認爲這是最接近Perl的die()函數(打印錯誤消息並在一個語句中退出)?

回答

0

答案是:

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