MCPcopy Create free account
hub / github.com/OpenPrinting/goipp / assertErrorIs

Function assertErrorIs

encdec_test.go:75–86  ·  view source on GitHub ↗

Check that err != nil and contains expected test

(t *testing.T, err error, s string)

Source from the content-addressed store, hash-verified

73
74// Check that err != nil and contains expected test
75func assertErrorIs(t *testing.T, err error, s string) {
76 if err == nil {
77 if s != "" {
78 t.Errorf("Error expected")
79 }
80 return
81 }
82
83 if !strings.HasPrefix(err.Error(), s) {
84 t.Errorf("Error is %q, expected %q", err, s)
85 }
86}
87
88// parseTime parses time given in time.Layout format.
89// this function panics if time cannot be parsed

Callers 4

TestEncodeErrorsFunction · 0.85
TestDecodeErrorsFunction · 0.85
TestDecodeValueErrorsFunction · 0.85
TestTagExtensionFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected