diff --git a/test/function/anonymous_function.lox b/test/function/anonymous_function.lox new file mode 100644 index 000000000..f4bab5636 --- /dev/null +++ b/test/function/anonymous_function.lox @@ -0,0 +1,13 @@ +fun thrice(fn) { + for (var i = 1; i <= 3; i = i + 1) { + fn(i); + } +} + +thrice(fun (a) { + print a; +}); + +// expect: "1" +// expect: "2" +// expect: "3" \ No newline at end of file