compiler: add tests for function literal

Add test forgotten in #934.
This commit is contained in:
Evgenii Stratonikov 2020-05-12 16:22:46 +03:00
parent e21015233b
commit 89b5e92b83

View file

@ -0,0 +1,15 @@
package compiler_test
import (
"math/big"
"testing"
)
func TestFuncLiteral(t *testing.T) {
src := `package foo
func Main() int {
inc := func(x int) int { return x + 1 }
return inc(1) + inc(2)
}`
eval(t, src, big.NewInt(5))
}