MCPcopy Create free account
hub / github.com/IceFireDB/IceFireDB / mustFail

Function mustFail

IceFireDB-PubSub/test/test_test.go:67–77  ·  view source on GitHub ↗

mustFail compares the error strings

(tb testing.TB, err error, want string)

Source from the content-addressed store, hash-verified

65
66// mustFail compares the error strings
67func mustFail(tb testing.TB, err error, want string) {
68 tb.Helper()
69 if err == nil {
70 tb.Errorf("expected an error, but got a nil")
71 return
72 }
73
74 if have := err.Error(); have != want {
75 tb.Errorf("have %q, want %q", have, want)
76 }
77}
78
79// execute a Do(args[,-1]...), which needs to be the same as the last arg.
80func mustDo(tb testing.TB, c *proto.Client, args ...string) {

Callers 1

TestSortedSetAddFunction · 0.70

Calls 1

ErrorMethod · 0.45

Tested by

no test coverage detected