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

Function expectErr

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

Source from the content-addressed store, hash-verified

1850}
1851
1852func expectErr(t *testing.T, err error, expected ...error) {
1853 t.Helper()
1854 if err == nil {
1855 t.Fatalf("Expected error but got none")
1856 }
1857 if len(expected) == 0 {
1858 return
1859 }
1860 for _, e := range expected {
1861 if errors.Is(err, e) {
1862 return
1863 }
1864 }
1865 t.Fatalf("Expected one of %+v, got '%v'", expected, err)
1866}
1867
1868func TestKeyValueCompression(t *testing.T) {
1869 s := RunBasicJetStreamServer()

Callers 15

TestKeyValueBasicsFunction · 0.70
TestKeyValueTTLFunction · 0.70
TestCreateKeyValueFunction · 0.70
TestUpdateKeyValueFunction · 0.70
TestKeyValueWatchFunction · 0.70
TestKeyValueBindStoreFunction · 0.70
TestKeyValueDeleteStoreFunction · 0.70
TestKeyValueKeysFunction · 0.70
TestObjectBasicsFunction · 0.70

Calls 2

FatalfMethod · 0.80
IsMethod · 0.45

Tested by

no test coverage detected