Skip to content

Commit

Permalink
one more test for function instantiate values scope
Browse files Browse the repository at this point in the history
  • Loading branch information
tfij committed Oct 13, 2016
1 parent 45a4e9f commit d82dd3f
Showing 1 changed file with 21 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -162,4 +162,25 @@ class OpelEngineFunctionIntegrationSpec extends Specification {
"val fun = (x, y) -> x*y; fun(2, 3, 4, 5)" || 6
}
def 'should avoid access to val defined in function outsite its'() {
given:
def engine = create().build()
when:
engine.eval(input).get()
then:
thrown OpelException
where:
input << ["""
val fun = (a) -> {
val x = 3;
a * 3
};
x
"""
]
}
}

0 comments on commit d82dd3f

Please sign in to comment.