diff --git a/src/test/java/ortus/boxlang/runtime/scripting/BoxScriptingEngineTest.java b/src/test/java/ortus/boxlang/runtime/scripting/BoxScriptingEngineTest.java index 80660b048..f5107f24a 100644 --- a/src/test/java/ortus/boxlang/runtime/scripting/BoxScriptingEngineTest.java +++ b/src/test/java/ortus/boxlang/runtime/scripting/BoxScriptingEngineTest.java @@ -65,6 +65,22 @@ public void testFunctionCallWithArguments() throws ScriptException, NoSuchMethod assertThat( result ).isEqualTo( "Hello, World!" ); } + @Test + public void testClosureCall() throws ScriptException, NoSuchMethodException { + engine.eval( "test = ( name ) => { return 'Hello, ' & arguments.1 & '!' }" ); + Invocable invocable = ( Invocable ) engine; + Object result = invocable.invokeFunction( "test", "World" ); + assertThat( result ).isEqualTo( "Hello, World!" ); + } + + @Test + public void testLambdaCall() throws ScriptException, NoSuchMethodException { + engine.eval( "test = ( name ) -> { return 'Hello, ' & arguments.1 & '!' }" ); + Invocable invocable = ( Invocable ) engine; + Object result = invocable.invokeFunction( "test", "World" ); + assertThat( result ).isEqualTo( "Hello, World!" ); + } + @DisplayName( "Eval a script with no bindings" ) @Test public void testEval() throws ScriptException {