(t *testing.T)
| 3669 | } |
| 3670 | if _, ok := c.cursors["cur2"]; !ok { |
| 3671 | t.Error("expected cur2 to still exist") |
| 3672 | } |
| 3673 | if _, ok := c.cursors["cur1"]; ok { |
| 3674 | t.Error("expected cur1 to be removed") |
| 3675 | } |
| 3676 | } |
| 3677 | |
| 3678 | func TestCursorCloseNonexistent(t *testing.T) { |
| 3679 | c := &clientConn{ |
| 3680 | cursors: map[string]*cursorState{ |
| 3681 | "cur1": {query: "SELECT 1"}, |
| 3682 | }, |
| 3683 | } |
| 3684 | |
| 3685 | // Should not panic |
| 3686 | c.closeCursor("nonexistent") |
| 3687 | |
| 3688 | if len(c.cursors) != 1 { |
| 3689 | t.Errorf("expected 1 cursor, got %d", len(c.cursors)) |
| 3690 | } |
| 3691 | } |
| 3692 | |
| 3693 | func TestTransactionStatusWithCopyCommands(t *testing.T) { |
| 3694 | c := &clientConn{txStatus: txStatusIdle} |
nothing calls this directly
no test coverage detected