Ensure a closed database returns an error while running a transaction block
(t *testing.T)
| 1003 | |
| 1004 | // Ensure a closed database returns an error while running a transaction block |
| 1005 | func TestDB_Update_Closed(t *testing.T) { |
| 1006 | var db bolt.DB |
| 1007 | if err := db.Update(func(tx *bolt.Tx) error { |
| 1008 | if _, err := tx.CreateBucket([]byte("widgets")); err != nil { |
| 1009 | t.Fatal(err) |
| 1010 | } |
| 1011 | return nil |
| 1012 | }); err != berrors.ErrDatabaseNotOpen { |
| 1013 | t.Fatalf("unexpected error: %s", err) |
| 1014 | } |
| 1015 | } |
| 1016 | |
| 1017 | // Ensure a panic occurs while trying to commit a managed transaction. |
| 1018 | func TestDB_Update_ManualCommit(t *testing.T) { |
nothing calls this directly
no test coverage detected