tests improved

This commit is contained in:
2024-06-26 04:29:40 +02:00
parent 7164e8816c
commit fe5c8e9619
8 changed files with 81 additions and 23 deletions
+2 -1
View File
@@ -30,12 +30,13 @@ func TestFuncs(t *testing.T) {
/* 16 */ {`f=func(x,n=2,y){x+n}`, nil, errors.New(`[1:16] can't mix default and non-default parameters`)},
/* 17 */ {`f=func(x,n){1}; f(3,4,)`, nil, errors.New(`[1:24] expected "function-param-value", got ")"`)},
/* 18 */ {`factory=func(base){func(){@base=base+1}}; inc10=factory(10); inc5=factory(5); inc10(); inc5(); inc10()`, int64(12), nil},
/* 19 */ {`f=func(a,y=1,z="sos"){}; string(f)`, `f(a, y=1, z="sos"):any{}`, nil},
// /* 18 */ {`f=func(a){a*2}`, nil, errors.New(`[1:24] expected "function-param-value", got ")"`)},
}
// t.Setenv("EXPR_PATH", ".")
// parserTestSpec(t, section, inputs, 17)
// runTestSuiteSpec(t, section, inputs, 17)
runTestSuite(t, section, inputs)
}