expr_test.go: added a test in passing functions as parameters
This commit is contained in:
parent
2150181303
commit
35fcbd2bce
@ -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)
|
||||
|
Loading…
Reference in New Issue
Block a user