diff --git a/funcs_test.go b/funcs_test.go index bd3b835..682d298 100644 --- a/funcs_test.go +++ b/funcs_test.go @@ -57,12 +57,14 @@ func TestFuncs(t *testing.T) { /* 44 */ {`builtin "string"; splitStr("one-two-three", "-", )`, newListA("one", "two", "three"), nil}, /* 45 */ {`isInt(2+1)`, true, nil}, /* 46 */ {`isInt(3.1)`, false, nil}, - /* 46 */ {`isFloat(3.1)`, true, nil}, - /* 47 */ {`isString("3.1")`, true, nil}, - /* 48 */ {`isString("3" + 1)`, true, nil}, - /* 49 */ {`isList(["3", 1])`, true, nil}, - /* 50 */ {`isDict({"a":"3", "b":1})`, true, nil}, - /* 51 */ {`isFract(3|1)`, true, nil}, + /* 47 */ {`isFloat(3.1)`, true, nil}, + /* 48 */ {`isString("3.1")`, true, nil}, + /* 49 */ {`isString("3" + 1)`, true, nil}, + /* 50 */ {`isList(["3", 1])`, true, nil}, + /* 51 */ {`isDict({"a":"3", "b":1})`, true, nil}, + /* 52 */ {`isFract(1|3)`, true, nil}, + /* 53 */ {`isFract(3|1)`, false, nil}, + /* 54 */ {`isRational(3|1)`, true, nil}, } t.Setenv("EXPR_PATH", ".") diff --git a/list_test.go b/list_test.go index 5494464..5f4b09d 100644 --- a/list_test.go +++ b/list_test.go @@ -39,6 +39,7 @@ func TestListParser(t *testing.T) { /* 17 */ {`list=["one","two","three"]; list.10`, nil, errors.New(`[1:36] index 10 out of bounds`)}, /* 18 */ {`["a", "b", "c"]`, newListA("a", "b", "c"), nil}, /* 19 */ {`["a", "b", "c"]`, newList([]any{"a", "b", "c"}), nil}, + /* 20 */ {`#["a", "b", "c"]`, int64(3), nil}, // /* 8 */ {`[int(x)|x=csv("test.csv",1,all(),1)]`, []any{int64(10), int64(40), int64(20)}, nil}, // /* 9 */ {`sum(@[int(x)|x=csv("test.csv",1,all(),1)])`, []any{int64(10), int64(40), int64(20)}, nil},