From ac065622757c25efc361f2a555226d425da4590b Mon Sep 17 00:00:00 2001 From: Boris Kayi Date: Sun, 3 Sep 2023 12:46:46 +0200 Subject: [PATCH] test: add more test case for recursive functions --- glox/interpreter/interpreter_test.go | 1 + 1 file changed, 1 insertion(+) diff --git a/glox/interpreter/interpreter_test.go b/glox/interpreter/interpreter_test.go index 153b319..494dd61 100644 --- a/glox/interpreter/interpreter_test.go +++ b/glox/interpreter/interpreter_test.go @@ -47,6 +47,7 @@ func TestInterpret(t *testing.T) { `let count=0; while(count<1){count=count+1;}`: "1", `let count=0; while(count<5){count=count+1;}`: "1\n2\n3\n4\n5", `fun greets(name){print "Hello "+name+"!";}greets("John");`: "Hello John!\n", + `fun count(n) {if(n > 1) count(n-1); print n;} count(5);`: "1\n\n2\n\n3\n\n4\n\n5\n", } for code, expected := range fixtures {