Iterator defined by data-source now only requires one method: next()

This commit is contained in:
2024-07-21 05:45:22 +02:00
parent 6ecbe2feb1
commit c461fd138e
3 changed files with 62 additions and 69 deletions
+3 -3
View File
@@ -19,8 +19,8 @@ func TestExpr(t *testing.T) {
/* 5 */ {`1 ? {1} : [1+0] {3*(1+1)}`, int64(6), nil},
/* 6 */ {`
ds={
"init":func(end){@end=end; @current=0 but true},
"current":func(){current},
"init":func(@end){@current=0 but true},
//"current":func(){current},
"next":func(){
((next=current+1) <= end) ? [true] {@current=next but current} :: {nil}
}
@@ -32,6 +32,6 @@ func TestExpr(t *testing.T) {
}
// t.Setenv("EXPR_PATH", ".")
// parserTestSpec(t, section, inputs, 3)
//runTestSuiteSpec(t, section, inputs, 6)
runTestSuite(t, section, inputs)
}