MCPcopy
hub / github.com/nats-io/nats.go / expectErr

Function expectErr

test/kv_test.go:1223–1237  ·  view source on GitHub ↗
(t *testing.T, err error, expected ...error)

Source from the content-addressed store, hash-verified

1221}
1222
1223func expectErr(t *testing.T, err error, expected ...error) {
1224 t.Helper()
1225 if err == nil {
1226 t.Fatalf("Expected error but got none")
1227 }
1228 if len(expected) == 0 {
1229 return
1230 }
1231 for _, e := range expected {
1232 if errors.Is(err, e) {
1233 return
1234 }
1235 }
1236 t.Fatalf("Expected one of %+v, got '%v'", expected, err)
1237}
1238
1239func TestListKeyValueStores(t *testing.T) {
1240 tests := []struct {

Callers 15

TestKeyValueBasicsFunction · 0.70
TestKeyValueWatchFunction · 0.70
TestKeyValueBindStoreFunction · 0.70
TestKeyValueDeleteStoreFunction · 0.70
TestKeyValueKeysFunction · 0.70
TestObjectBasicsFunction · 0.70
TestObjectDeleteMarkersFunction · 0.70
TestObjectNamesFunction · 0.70
TestObjectMetadataFunction · 0.70

Calls 2

FatalfMethod · 0.80
IsMethod · 0.45

Tested by

no test coverage detected