at operator return -1 when fails in lists and arrays; insert operators (<< and >>) changes che container if it is a variable
This commit is contained in:
+10
-10
@@ -40,13 +40,13 @@ func TestFuncBase(t *testing.T) {
|
||||
/* 23 */ {`fract("1.21(3)")`, fract.NewFraction(91, 75), nil},
|
||||
/* 24 */ {`fract(1.21(3))`, fract.NewFraction(91, 75), nil},
|
||||
/* 25 */ {`fract(1.21)`, fract.NewFraction(121, 100), nil},
|
||||
/* 26 */ {`dec(2)`, float64(2), nil},
|
||||
/* 27 */ {`dec(2.0)`, float64(2), nil},
|
||||
/* 28 */ {`dec("2.0")`, float64(2), nil},
|
||||
/* 29 */ {`dec(true)`, float64(1), nil},
|
||||
/* 30 */ {`dec(true")`, nil, "[1:11] expected one of `,`, `)`, got `\"`"},
|
||||
/* 31 */ {`dec()`, nil, `dec(): too few params -- expected 1, got 0`},
|
||||
/* 32 */ {`dec(1,2,3)`, nil, `dec(): too many params -- expected 1, got 3`},
|
||||
/* 26 */ {`float(2)`, float64(2), nil},
|
||||
/* 27 */ {`float(2.0)`, float64(2), nil},
|
||||
/* 28 */ {`float("2.0")`, float64(2), nil},
|
||||
/* 29 */ {`float(true)`, float64(1), nil},
|
||||
/* 30 */ {`float(true")`, nil, "[1:13] expected one of `,`, `)`, got `\"`"},
|
||||
/* 31 */ {`float()`, nil, `float(): too few params -- expected 1, got 0`},
|
||||
/* 32 */ {`float(1,2,3)`, nil, `float(): too many params -- expected 1, got 3`},
|
||||
/* 33 */ {`isBool(false)`, true, nil},
|
||||
/* 34 */ {`fract(1:2)`, fract.NewFraction(1, 2), nil},
|
||||
/* 35 */ {`fract(12,2)`, fract.NewFraction(6, 1), nil},
|
||||
@@ -59,9 +59,9 @@ func TestFuncBase(t *testing.T) {
|
||||
/* 42 */ {`bool([])`, false, nil},
|
||||
/* 43 */ {`bool({})`, false, nil},
|
||||
/* 44 */ {`bool({1:"one"})`, true, nil},
|
||||
/* 45 */ {`dec(false)`, float64(0), nil},
|
||||
/* 46 */ {`dec(1:2)`, float64(0.5), nil},
|
||||
/* 47 */ {`dec([1])`, nil, `dec(): can't convert array to float`},
|
||||
/* 45 */ {`float(false)`, float64(0), nil},
|
||||
/* 46 */ {`float(1:2)`, float64(0.5), nil},
|
||||
/* 47 */ {`float([1])`, nil, `float(): can't convert array to float`},
|
||||
/* 48 */ {`eval("a=3"); a`, int64(3), nil},
|
||||
/* 49 */ {`int(5:2)`, int64(2), nil},
|
||||
|
||||
|
||||
Reference in New Issue
Block a user