expr_test.go: added a test in passing functions as parameters

This commit is contained in:
Celestino Amoroso 2024-04-15 06:59:27 +02:00
parent 2150181303
commit 35fcbd2bce

View File

@ -25,7 +25,8 @@ func TestExpr(t *testing.T) {
failed := 0
inputs1 := []inputType{
{`f = func(op){op()}; f(func(){2})`, int64(2), nil},
{`f=openFile("/tmp/test2.txt"); line=readFile(f); closeFile(f); line`, "ciao", nil},
//{`f = func(op){op()}; f(func(){2})`, int64(2), nil},
}
for i, input := range inputs1 {
@ -36,6 +37,7 @@ func TestExpr(t *testing.T) {
ctx := NewSimpleFuncStore()
// ImportMathFuncs(ctx)
// ImportImportFunc(ctx)
ImportOsFuncs(ctx)
parser := NewParser(ctx)
logTest(t, i+1, input.source, input.wantResult, input.wantErr)