MCPcopy
hub / github.com/jackc/pgx / TestConnSendBatchReadResultsWhenNothingQueued

Function TestConnSendBatchReadResultsWhenNothingQueued

batch_test.go:298–313  ·  view source on GitHub ↗

https://github.com/jackc/pgx/issues/1801#issuecomment-2203784178

(t *testing.T)

Source from the content-addressed store, hash-verified

296
297// https://github.com/jackc/pgx/issues/1801#issuecomment-2203784178
298func TestConnSendBatchReadResultsWhenNothingQueued(t *testing.T) {
299 t.Parallel()
300
301 ctx, cancel := context.WithTimeout(context.Background(), 120*time.Second)
302 defer cancel()
303
304 pgxtest.RunWithQueryExecModes(ctx, t, defaultConnTestRunner, nil, func(ctx context.Context, t testing.TB, conn *pgx.Conn) {
305 batch := &pgx.Batch{}
306 br := conn.SendBatch(ctx, batch)
307 commandTag, err := br.Exec()
308 require.Equal(t, "", commandTag.String())
309 require.EqualError(t, err, "no more results in batch")
310 err = br.Close()
311 require.NoError(t, err)
312 })
313}
314
315func TestConnSendBatchReadMoreResultsThanQueriesSent(t *testing.T) {
316 t.Parallel()

Callers

nothing calls this directly

Calls 5

RunWithQueryExecModesFunction · 0.92
SendBatchMethod · 0.65
ExecMethod · 0.65
CloseMethod · 0.65
StringMethod · 0.45

Tested by

no test coverage detected