iter-iter: changed item operation from function and args to a list of expressions

This commit is contained in:
2026-05-06 04:04:08 +02:00
parent acd4f8487d
commit 5585b496fb
7 changed files with 86 additions and 99 deletions
+4 -3
View File
@@ -14,11 +14,12 @@ func TestIterIterator(t *testing.T) {
section := "Iterator"
inputs := []inputType{
/* 1 */ {`it=$(4); $(it) filter ${_}==100`, kern.NewListA(), nil},
/* 2 */ {`it=$(4); $(it, func(){$_}) filter ${_}==100`, kern.NewListA(), nil},
/* 3 */ {`it=$(4); $(it, func(arg1){arg1+$_}, 10) filter ${_}==100`, kern.NewListA(), nil},
/* 2 */ {`it=$(4); $(it, $_) filter ${_}==100`, kern.NewListA(), nil},
/* 3 */ {`it=$(4); $(it, 10+$_, last-1) digest ${_}`, int64(12), nil},
/* 4 */ {`f=func(n){last-n}; it=$(4); $(it, 10+$_, f(-1)) digest ${_}`, int64(14), nil},
}
runTestSuiteSpec(t, section, inputs, 3)
runTestSuiteSpec(t, section, inputs, 4)
// runTestSuite(t, section, inputs)
}