(t *testing.T)
| 530 | } |
| 531 | } |
| 532 | |
| 533 | func TestTransactionErrorStatus(t *testing.T) { |
| 534 | c := &clientConn{txStatus: txStatusIdle} |
| 535 | |
| 536 | // Error outside transaction should not change status |
| 537 | c.setTxError() |
| 538 | if c.txStatus != txStatusIdle { |
| 539 | t.Errorf("error outside transaction txStatus = %c, want %c", c.txStatus, txStatusIdle) |
| 540 | } |
| 541 | |
| 542 | // Error inside transaction should set to error |
| 543 | c.updateTxStatus("BEGIN") |
| 544 | c.setTxError() |
| 545 | if c.txStatus != txStatusError { |
| 546 | t.Errorf("error inside transaction txStatus = %c, want %c", c.txStatus, txStatusError) |
| 547 | } |
| 548 | |
| 549 | // ROLLBACK should recover from error state |
| 550 | c.updateTxStatus("ROLLBACK") |
| 551 | if c.txStatus != txStatusIdle { |
| 552 | t.Errorf("after ROLLBACK from error txStatus = %c, want %c", c.txStatus, txStatusIdle) |
| 553 | } |
| 554 | } |
| 555 | |
| 556 | func TestNestedBeginDetection(t *testing.T) { |
nothing calls this directly
no test coverage detected