Skip to content

Commit

Permalink
test: add test case for void functions
Browse files Browse the repository at this point in the history
  • Loading branch information
silverhairs committed Aug 29, 2023
1 parent 1e50fbc commit 692679f
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions glox/interpreter/interpreter_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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<nil>",
}

for code, expected := range fixtures {
Expand Down

0 comments on commit 692679f

Please sign in to comment.