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

Function TestIssuesEmpty

cel/env_test.go:73–90  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

71}
72
73func TestIssuesEmpty(t *testing.T) {
74 iss := NewIssues(common.NewErrors(nil))
75 if iss.Err() != nil {
76 t.Errorf("iss.Err() got %v, wanted nil given nil issue set", iss.Err())
77 }
78 if len(iss.Errors()) != 0 {
79 t.Errorf("iss.Errors() got %v, wanted empty value", iss.Errors())
80 }
81 if iss.String() != "" {
82 t.Errorf("iss.String() returned %v, wanted empty value", iss.String())
83 }
84 var iss2 *Issues
85 iss3 := iss.Append(iss2)
86 iss4 := iss3.Append(nil)
87 if !reflect.DeepEqual(iss4, iss) {
88 t.Error("Append() with a nil value resulted in the creation of a new issue set")
89 }
90}
91
92func TestErrorAsIssues(t *testing.T) {
93 iss := ErrorAsIssues(errors.New("wrapped-error"))

Callers

nothing calls this directly

Calls 7

ErrMethod · 0.95
ErrorsMethod · 0.95
StringMethod · 0.95
AppendMethod · 0.95
NewErrorsFunction · 0.92
NewIssuesFunction · 0.85
ErrorMethod · 0.45

Tested by

no test coverage detected