New operator unset to delete variables and functions from current context

This commit is contained in:
2024-07-13 09:01:59 +02:00
parent f3cc0cc7ad
commit 032916d4fa
3 changed files with 93 additions and 0 deletions
+22
View File
@@ -0,0 +1,22 @@
// Copyright (c) 2024 Celestino Amoroso (celestino.amoroso@gmail.com).
// All rights reserved.
// t_operator_test.go
package expr
import (
"testing"
)
func TestOperator(t *testing.T) {
section := "Operator"
inputs := []inputType{
/* 1 */ {`a=1; unset "a"; a`, nil, `undefined variable or function "a"`},
/* 2 */ {`a=1; unset ["a", "b"]`, int64(1), nil},
}
// t.Setenv("EXPR_PATH", ".")
runTestSuiteSpec(t, section, inputs, 2)
//runTestSuite(t, section, inputs)
}