builtin-base.go: new eval() function

This commit is contained in:
2024-12-27 07:14:26 +01:00
parent b38327b841
commit 646710e180
2 changed files with 31 additions and 1 deletions
+2 -1
View File
@@ -56,11 +56,12 @@ func TestFuncBase(t *testing.T) {
/* 42 */ {`dec(false)`, float64(0), nil},
/* 43 */ {`dec(1:2)`, float64(0.5), nil},
/* 44 */ {`dec([1])`, nil, `dec(): can't convert list to float`},
/* 45 */ {`eval("a=3"); a`, int64(3), nil},
// /* 45 */ {`string([1])`, nil, `string(): can't convert list to string`},
}
t.Setenv("EXPR_PATH", ".")
// runTestSuiteSpec(t, section, inputs, 30)
// runTestSuiteSpec(t, section, inputs, 45)
runTestSuite(t, section, inputs)
}