Describe the bug
A new funcionality with ExpectBatch() function doesn`t match Batch() expectation, when we are trying to follow expectations without straight order using pgxmock.MatchExpectationsInOrder(false).
To Reproduce
func processBatch(db pgxmock.PgxPoolIface) error {
batch := &pgx.Batch{}
// Random order
batch.Queue("SELECT id FROM normalized_queries WHERE query = $1", "some query")
batch.Queue("INSERT INTO normalized_queries (query) VALUES ($1) RETURNING id", "some query")
results := db.SendBatch(context.Background(), batch)
defer results.Close()
for i := 0; i < batch.Len(); i++ {
var id int
err := results.QueryRow().Scan(&id)
if err != nil {
return err
}
}
return nil
}
Describe the bug A new funcionality with ExpectBatch() function doesn`t match Batch() expectation, when we are trying to follow expectations without straight order using pgxmock.MatchExpectationsInOrder(false).
To Reproduce
Screenshot of the issue
Expected behavior
Screenshot of the expected behaviour
Desktop: