From 3b2fd8f2d3e376fa7a3f3b2ba665fcd4a5b5bb15 Mon Sep 17 00:00:00 2001 From: Ben Johnson Date: Sat, 22 Feb 2014 22:54:54 -0700 Subject: Revert "Refactor Transaction/Bucket API." This reverts commit 1ad2b99f281d587b767b36f886401e81d17915a9. --- bucket_test.go | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) (limited to 'bucket_test.go') diff --git a/bucket_test.go b/bucket_test.go index 2778432..5e33189 100644 --- a/bucket_test.go +++ b/bucket_test.go @@ -11,26 +11,23 @@ import ( // Ensure a bucket can calculate stats. func TestBucketStat(t *testing.T) { withOpenDB(func(db *DB, path string) { - db.Do(func(txn *Transaction) error { + db.Do(func(txn *RWTransaction) error { // Add bucket with lots of keys. txn.CreateBucket("widgets") - b := txn.Bucket("widgets") for i := 0; i < 100000; i++ { - b.Put([]byte(strconv.Itoa(i)), []byte(strconv.Itoa(i))) + txn.Put("widgets", []byte(strconv.Itoa(i)), []byte(strconv.Itoa(i))) } // Add bucket with fewer keys but one big value. txn.CreateBucket("woojits") - b = txn.Bucket("woojits") for i := 0; i < 500; i++ { - b.Put([]byte(strconv.Itoa(i)), []byte(strconv.Itoa(i))) + txn.Put("woojits", []byte(strconv.Itoa(i)), []byte(strconv.Itoa(i))) } - b.Put([]byte("really-big-value"), []byte(strings.Repeat("*", 10000))) + txn.Put("woojits", []byte("really-big-value"), []byte(strings.Repeat("*", 10000))) // Add a bucket that fits on a single root leaf. txn.CreateBucket("whozawhats") - b = txn.Bucket("whozawhats") - b.Put([]byte("foo"), []byte("bar")) + txn.Put("whozawhats", []byte("foo"), []byte("bar")) return nil }) -- cgit v1.2.3