dataCursor implements Typer interface

This commit is contained in:
Celestino Amoroso 2024-07-06 16:05:54 +02:00
parent fd8e32e12b
commit d2a4adebdd
2 changed files with 7 additions and 1 deletions

View File

@ -29,6 +29,10 @@ func newDataCursor(ctx ExprContext, ds map[string]Functor) (dc *dataCursor) {
return return
} }
func (dc *dataCursor) TypeName() string {
return "DataCursor"
}
// func mapToString(m map[string]Functor) string { // func mapToString(m map[string]Functor) string {
// var sb strings.Builder // var sb strings.Builder
// sb.WriteByte('{') // sb.WriteByte('{')

View File

@ -7,6 +7,7 @@ package expr
import "testing" import "testing"
func TestIteratorParser(t *testing.T) { func TestIteratorParser(t *testing.T) {
section := "Iterator"
inputs := []inputType{ inputs := []inputType{
/* 1 */ {`include "test-resources/iterator.expr"; it=$(ds,3); ()it`, int64(0), nil}, /* 1 */ {`include "test-resources/iterator.expr"; it=$(ds,3); ()it`, int64(0), nil},
/* 2 */ {`include "test-resources/iterator.expr"; it=$(ds,3); it++; it++`, int64(1), nil}, /* 2 */ {`include "test-resources/iterator.expr"; it=$(ds,3); it++; it++`, int64(1), nil},
@ -22,5 +23,6 @@ func TestIteratorParser(t *testing.T) {
// inputs1 := []inputType{ // inputs1 := []inputType{
// /* 1 */ {`0?{}`, nil, nil}, // /* 1 */ {`0?{}`, nil, nil},
// } // }
runTestSuite(t, "Iterator", inputs) // runTestSuiteSpec(t, section, inputs, 1)
runTestSuite(t, section, inputs)
} }