diff --git a/t_iterator_test.go b/t_iterator_test.go index 250b1e9..00eb8f5 100644 --- a/t_iterator_test.go +++ b/t_iterator_test.go @@ -23,6 +23,6 @@ func TestIteratorParser(t *testing.T) { /* 12 */ {`include "test-resources/filter.expr"; it=$(ds,10); it++`, int64(2), nil}, } - runTestSuiteSpec(t, section, inputs, 12) - //runTestSuite(t, section, inputs) + //runTestSuiteSpec(t, section, inputs, 12) + runTestSuite(t, section, inputs) } diff --git a/test-resources/filter.expr b/test-resources/filter.expr new file mode 100644 index 0000000..75c4b5c --- /dev/null +++ b/test-resources/filter.expr @@ -0,0 +1,15 @@ +ds={ + "init":func(end){@end=end; @current=0 but true}, + "current":func(){current}, + "next":func(){ + ((next=current+1) <= end) ? [true] {@current=next but current} :: {nil} + } + , "filter":func(item,index) { item > 0 } + , "map": func(item,index) { item * 2 } +} + +/* Example +; +it=$(ds,3); +add(it) +*/