Skip to content

Commit

Permalink
more testcases
Browse files Browse the repository at this point in the history
  • Loading branch information
JVerbruggen committed Dec 17, 2021
1 parent 700c918 commit e1fea0c
Showing 1 changed file with 30 additions and 0 deletions.
30 changes: 30 additions & 0 deletions test.jur
Original file line number Diff line number Diff line change
Expand Up @@ -146,19 +146,49 @@ func rettester{
if true{
if true{
if false{
changed = 1
return false
}else{
changed = 1
return true
}
}else{
changed = 1
return false
}
}else{
changed = 1
return false
}
}

changed = 0
val = rettester()
assert val
assert changed == 1

func nothingafterreturn{
assert true
return true
assert false
}

nothingafterreturn()


func add a b{
return a + b
}

func mul a b{
return a * b
}

func someoper a b oper{
return oper(a, b)
}

assert someoper(3, 3, add) == 6
assert someoper(3, 3, mul) == 9

print "success"

0 comments on commit e1fea0c

Please sign in to comment.