diff --git a/glox/interpreter/interpreter_test.go b/glox/interpreter/interpreter_test.go index e3c6cfe..153b319 100644 --- a/glox/interpreter/interpreter_test.go +++ b/glox/interpreter/interpreter_test.go @@ -46,6 +46,7 @@ func TestInterpret(t *testing.T) { `let age = 17; if(age>18 or age > 21){ print "can drink"; } else { print "can't drink"; }`: "can't drink", `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", } for code, expected := range fixtures {