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

Function TestWriteBufferSize

nats_test.go:1919–1932  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

1917}
1918
1919func TestWriteBufferSize(t *testing.T) {
1920 opts := GetDefaultOptions()
1921 opts.WriteBufferSize = 64 * 1024
1922 opts.Servers = []string{"nats://127.0.0.1:4222"}
1923 nc := &Conn{Opts: opts}
1924 nc.newReaderWriter()
1925
1926 if nc.bw.limit != 64*1024 {
1927 t.Fatalf("Expected write buffer limit of %d, got %d", 64*1024, nc.bw.limit)
1928 }
1929 if len(nc.br.buf) != defaultBufSize {
1930 t.Fatalf("Expected read buffer size of %d, got %d", defaultBufSize, len(nc.br.buf))
1931 }
1932}
1933
1934func TestWriteBufferSizeDefault(t *testing.T) {
1935 opts := GetDefaultOptions()

Callers

nothing calls this directly

Calls 3

newReaderWriterMethod · 0.95
GetDefaultOptionsFunction · 0.85
FatalfMethod · 0.80

Tested by

no test coverage detected