MCPcopy Create free account
hub / github.com/cel-expr/cel-go / TestNewVariable

Function TestNewVariable

common/decls/decls_test.go:1242–1254  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

1240}
1241
1242func TestNewVariable(t *testing.T) {
1243 a := NewVariable("a", types.BoolType)
1244 if !a.DeclarationIsEquivalent(a) {
1245 t.Error("NewVariable(a, bool) does not equal itself")
1246 }
1247 if !a.DeclarationIsEquivalent(NewVariable("a", types.BoolType)) {
1248 t.Error("NewVariable(a, bool) does not equal itself")
1249 }
1250 a1 := NewVariable("a", types.IntType)
1251 if a.DeclarationIsEquivalent(a1) {
1252 t.Error("NewVariable(a, int).DeclarationEquals(NewVariable(a, bool))")
1253 }
1254}
1255
1256func TestNewConstant(t *testing.T) {
1257 a := NewConstant("a", types.IntType, types.Int(42))

Callers

nothing calls this directly

Calls 3

NewVariableFunction · 0.70
ErrorMethod · 0.45

Tested by

no test coverage detected