Ensure that opening a transaction while the DB is closed returns an error.
(t *testing.T)
| 904 | |
| 905 | // Ensure that opening a transaction while the DB is closed returns an error. |
| 906 | func TestDB_BeginRW_Closed(t *testing.T) { |
| 907 | var db bolt.DB |
| 908 | if _, err := db.Begin(true); err != berrors.ErrDatabaseNotOpen { |
| 909 | t.Fatalf("unexpected error: %s", err) |
| 910 | } |
| 911 | } |
| 912 | |
| 913 | func TestDB_Close_PendingTx_RW(t *testing.T) { testDB_Close_PendingTx(t, true) } |
| 914 | func TestDB_Close_PendingTx_RO(t *testing.T) { testDB_Close_PendingTx(t, false) } |