diff --git a/funcs_test.go b/funcs_test.go index 1c58e3e..7df2e82 100644 --- a/funcs_test.go +++ b/funcs_test.go @@ -68,6 +68,15 @@ func TestFuncs(t *testing.T) { /* 55 */ {`builtin "math.arith"; add(1,2)`, int64(3), nil}, /* 56 */ {`fract("2.2(3)")`, newFraction(67, 30), nil}, /* 57 */ {`fract("1.21(3)")`, newFraction(91, 75), nil}, + /* 58 */ {`fract(1.21(3))`, newFraction(91, 75), nil}, + /* 59 */ {`fract(1.21)`, newFraction(121, 100), nil}, + /* 60 */ {`dec(2)`, float64(2), nil}, + /* 61 */ {`dec(2.0)`, float64(2), nil}, + /* 62 */ {`dec("2.0")`, float64(2), nil}, + /* 63 */ {`dec(true)`, float64(1), nil}, + /* 64 */ {`dec(true")`, nil, errors.New("[1:11] missing string termination \"")}, + /* 65 */ {`builtin "string"; joinStr("-", [1, "two", "three"])`, nil, errors.New(`joinStr() expected string, got int64 (1)`)}, + // /* 64 */ {`string(true)`, "true", nil}, } t.Setenv("EXPR_PATH", ".")