builtin-base: removed useless function unset(). See UNSET operator

This commit is contained in:
2026-05-03 06:46:51 +02:00
parent bb6b6d17ec
commit 23b8eec74a
5 changed files with 84 additions and 43 deletions
+12
View File
@@ -49,6 +49,18 @@ func TestFuncs(t *testing.T) {
runTestSuite(t, section, inputs)
}
func TestFuncs2(t *testing.T) {
section := "Funcs2"
inputs := []inputType{
/* 1 */ {`sum=func(a,b){a+b}; sum(1,2)`, int64(3), nil},
/* 2 */ {`sum=func(a,b){a+b}; sum(1)`, nil, `sum(): too few params -- expected 2, got 1`},
/* 3 */ {`["1", "2", "3"] map int()`, nil, `int(): too few params -- expected 1, got 0`},
/* 4 */ {`builtin "iterator"; times=func(a,b){a*b}; run($(["1", "2", "3"]), times)`, nil, `operator(): missing params -- a, b`},
}
// runTestSuiteSpec(t, section, inputs, 4)
runTestSuite(t, section, inputs)
}
func dummy(ctx kern.ExprContext, name string, args map[string]any) (result any, err error) {
return
}