linked-list: sum and in operators
This commit is contained in:
+6
-2
@@ -11,8 +11,8 @@ import (
|
||||
"git.portale-stac.it/go-pkg/expr/types/list"
|
||||
)
|
||||
|
||||
func TestListParser(t *testing.T) {
|
||||
section := "List"
|
||||
func TestArray(t *testing.T) {
|
||||
section := "Array"
|
||||
|
||||
inputs := []inputType{
|
||||
/* 1 */ {`[]`, array.NewArrayA(), nil},
|
||||
@@ -76,6 +76,10 @@ func TestLinkedListParser(t *testing.T) {
|
||||
/* 3 */ {`it=$([<1,2,3>]); #($$(it))`, int64(3), nil},
|
||||
/* 4 */ {`[<1,2,3>][0]`, int64(1), nil},
|
||||
/* 5 */ {`[<1,2,3>][0:2]`, list.NewLinkedListA(1, 2), nil},
|
||||
/* 6 */ {`[<1>] + [<2,3>]`, list.NewLinkedListA(1, 2, 3), nil},
|
||||
/* 7 */ {`L=[<1>] + [<2,3>]; L[0]=100; L`, list.NewLinkedListA(100, 2, 3), nil},
|
||||
/* 8 */ {`builtin "base"; L=[<1>]; isList(L)`, true, nil},
|
||||
/* 9 */ {`2 IN [<1,2,3>]`, true, nil},
|
||||
}
|
||||
|
||||
// t.Setenv("EXPR_PATH", ".")
|
||||
|
||||
Reference in New Issue
Block a user