MCPcopy
hub / github.com/etcd-io/bbolt / TestDB_BeginRW_Closed

Function TestDB_BeginRW_Closed

db_test.go:906–911  ·  view source on GitHub ↗

Ensure that opening a transaction while the DB is closed returns an error.

(t *testing.T)

Source from the content-addressed store, hash-verified

904
905// Ensure that opening a transaction while the DB is closed returns an error.
906func 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
913func TestDB_Close_PendingTx_RW(t *testing.T) { testDB_Close_PendingTx(t, true) }
914func TestDB_Close_PendingTx_RO(t *testing.T) { testDB_Close_PendingTx(t, false) }

Callers

nothing calls this directly

Calls 2

BeginMethod · 0.95
FatalfMethod · 0.65

Tested by

no test coverage detected