Friday 1 October 2021

Assertions in Groovy Scripting groovy training videos in telugu 06

 Watch This Video


assert one expression ==onother expression

assert true
assert 1==1

//like the example above we are evaluating an expression

def x=1

assert x==1

//what happens when the expression doesnot evaluate to true

assert false

assert 1==2

//complex debug output

assert 1==(3+10)*100/5*20


def x=2
def y=7
def z=5

def calc ={a,b -> a*b+1}

assert calc(x,y)==z*z:'incorrect computation result'

No comments:

Post a Comment

Note: only a member of this blog may post a comment.