diff options
Diffstat (limited to 'rwtransaction_test.go')
-rw-r--r-- | rwtransaction_test.go | 24 |
1 files changed, 4 insertions, 20 deletions
diff --git a/rwtransaction_test.go b/rwtransaction_test.go index 2bcf252..b6e971e 100644 --- a/rwtransaction_test.go +++ b/rwtransaction_test.go @@ -19,28 +19,12 @@ func TestRWTransaction(t *testing.T) { func TestTransactionCreateBucket(t *testing.T) { withOpenDB(func(db *DB, path string) { // Create a bucket. - txn, _ := db.RWTransaction() - err := txn.CreateBucket("widgets") + err := db.CreateBucket("widgets") assert.NoError(t, err) - // Commit the transaction. - err = txn.Commit() + // Read the bucket through a separate transaction. + b, err := db.Bucket("widgets") + assert.NotNil(t, b) assert.NoError(t, err) - - // Open a separate read-only transaction. - rtxn, err := db.Transaction() - assert.NotNil(t, txn) - assert.NoError(t, err) - - b := rtxn.Bucket("widgets") - assert.NoError(t, err) - if assert.NotNil(t, b) { - assert.Equal(t, b.Name(), "widgets") - } }) } - -// Ensure that an existing bucket cannot be created. -func TestTransactionCreateExistingBucket(t *testing.T) { - t.Skip("pending") -} |