moved a subset of source file to the kern package
This commit is contained in:
+8
-6
@@ -7,6 +7,8 @@ package expr
|
||||
import (
|
||||
"errors"
|
||||
"testing"
|
||||
|
||||
"git.portale-stac.it/go-pkg/expr/kern"
|
||||
)
|
||||
|
||||
func TestBool(t *testing.T) {
|
||||
@@ -19,10 +21,10 @@ func TestBool(t *testing.T) {
|
||||
/* 5 */ {`not "true"`, false, nil},
|
||||
/* 6 */ {`not "false"`, false, nil},
|
||||
/* 7 */ {`not ""`, true, nil},
|
||||
/* 8 */ {`not []`, nil, errors.New(`[1:4] prefix/postfix operator "NOT" do not support operand '[]' [list]`)},
|
||||
/* 8 */ {`not []`, nil, errors.New(`[1:4] prefix/postfix operator "NOT" does not support operand '[]' [list]`)},
|
||||
/* 9 */ {`true and false`, false, nil},
|
||||
/* 10 */ {`true and []`, nil, errors.New(`[1:9] left operand 'true' [bool] and right operand '[]' [list] are not compatible with operator "AND"`)},
|
||||
/* 11 */ {`[] and false`, nil, errors.New(`got list as left operand type of 'AND' operator, it must be bool`)},
|
||||
/* 11 */ {`[] and false`, nil, errors.New(`[1:7] operator "AND" does not support operand '[]' [list] on its left side`)},
|
||||
/* 12 */ {`true or false`, true, nil},
|
||||
/* 13 */ {`true or []`, true, nil},
|
||||
/* 14 */ {`[] or false`, nil, errors.New(`got list as left operand type of 'OR' operator, it must be bool`)},
|
||||
@@ -32,7 +34,7 @@ func TestBool(t *testing.T) {
|
||||
|
||||
// t.Setenv("EXPR_PATH", ".")
|
||||
|
||||
// runTestSuiteSpec(t, section, inputs, 15)
|
||||
// runTestSuiteSpec(t, section, inputs, 13)
|
||||
runTestSuite(t, section, inputs)
|
||||
}
|
||||
|
||||
@@ -46,7 +48,7 @@ func TestBoolNoShortcut(t *testing.T) {
|
||||
/* 5 */ {`not "true"`, false, nil},
|
||||
/* 6 */ {`not "false"`, false, nil},
|
||||
/* 7 */ {`not ""`, true, nil},
|
||||
/* 8 */ {`not []`, nil, `[1:4] prefix/postfix operator "NOT" do not support operand '[]' [list]`},
|
||||
/* 8 */ {`not []`, nil, `[1:4] prefix/postfix operator "NOT" does not support operand '[]' [list]`},
|
||||
/* 9 */ {`true and false`, false, nil},
|
||||
/* 10 */ {`true and []`, nil, `[1:9] left operand 'true' [bool] and right operand '[]' [list] are not compatible with operator "AND"`},
|
||||
/* 11 */ {`[] and false`, nil, `[1:7] left operand '[]' [list] and right operand 'false' [bool] are not compatible with operator "AND"`},
|
||||
@@ -58,10 +60,10 @@ func TestBoolNoShortcut(t *testing.T) {
|
||||
// t.Setenv("EXPR_PATH", ".")
|
||||
|
||||
ctx := NewSimpleStore()
|
||||
current := SetCtrl(ctx, ControlBoolShortcut, false)
|
||||
current := kern.SetCtrl(ctx, kern.ControlBoolShortcut, false)
|
||||
|
||||
// runCtxTestSuiteSpec(t, ctx, section, inputs, 1)
|
||||
runCtxTestSuite(t, ctx, section, inputs)
|
||||
|
||||
SetCtrl(ctx, ControlBoolShortcut, current)
|
||||
kern.SetCtrl(ctx, kern.ControlBoolShortcut, current)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user