diff options
Diffstat (limited to 'tests/dedo.go')
-rw-r--r-- | tests/dedo.go | 40 |
1 files changed, 20 insertions, 20 deletions
diff --git a/tests/dedo.go b/tests/dedo.go index bce24b5..d0489ee 100644 --- a/tests/dedo.go +++ b/tests/dedo.go @@ -656,7 +656,7 @@ func TestBucket_Get_Capacity(t *testing.T) { // Retrieve value and attempt to append to it. err = db.Update(func(tx TransactionI) error { - k, v := g.Must(tx.RWBucket([]byte("bucket"))).Cursor().First() + k, v := g.Must(tx.RWBucket([]byte("bucket"))).RWCursor().First() // Verify capacity. if len(k) != cap(k) { @@ -1009,7 +1009,7 @@ func TestBucket_Delete_FreelistOverflow(t *testing.T) { // Delete all of them in one large transaction err := db.Update(func(tx TransactionI) error { b := g.Must(tx.RWBucket([]byte("0"))) - c := b.Cursor() + c := b.RWCursor() for k, _ := c.First(); k != nil; k, _ = c.Next() { err := c.Delete() if err != nil { @@ -2224,7 +2224,7 @@ func TestCursor_Seek(t *testing.T) { } err = db.View(func(snapshot SnapshotI) error { - c := g.Must(snapshot.ROBucket([]byte("widgets"))).Cursor() + c := g.Must(snapshot.ROBucket([]byte("widgets"))).ROCursor() // Exact match should go to the key. k, v := c.Seek([]byte("bar")) @@ -2308,7 +2308,7 @@ func TestCursor_Delete(t *testing.T) { } err = db.Update(func(tx TransactionI) error { - c := g.Must(tx.RWBucket([]byte("widgets"))).Cursor() + c := g.Must(tx.RWBucket([]byte("widgets"))).RWCursor() bound := make([]byte, 8) binary.BigEndian.PutUint64(bound, uint64(count/2)) for @@ -2370,7 +2370,7 @@ func TestCursor_Seek_Large(t *testing.T) { } err = db.View(func(snapshot SnapshotI) error { - c := g.Must(snapshot.ROBucket([]byte("widgets"))).Cursor() + c := g.Must(snapshot.ROBucket([]byte("widgets"))).ROCursor() for i := 0; i < count; i++ { seek := make([]byte, 8) binary.BigEndian.PutUint64(seek, uint64(i)) @@ -2422,7 +2422,7 @@ func TestCursor_EmptyBucket(t *testing.T) { } err = db.View(func(snapshot SnapshotI) error { - c := g.Must(snapshot.ROBucket([]byte("widgets"))).Cursor() + c := g.Must(snapshot.ROBucket([]byte("widgets"))).ROCursor() k, v := c.First() if k != nil { t.Fatalf("unexpected key: %v", k) @@ -2452,7 +2452,7 @@ func TestCursor_EmptyBucketReverse(t *testing.T) { } err = db.View(func(snapshot SnapshotI) error { - c := g.Must(snapshot.ROBucket([]byte("widgets"))).Cursor() + c := g.Must(snapshot.ROBucket([]byte("widgets"))).ROCursor() k, v := c.Last() if k != nil { t.Fatalf("unexpected key: %v", k) @@ -2506,7 +2506,7 @@ func TestCursor_Iterate_Leaf(t *testing.T) { } defer func() { _ = tx.rollback() }() - c := g.Must(tx.RWBucket([]byte("widgets"))).Cursor() + c := g.Must(tx.ROBucket([]byte("widgets"))).ROCursor() k, v := c.First() if !bytes.Equal(k, []byte("bar")) { @@ -2588,7 +2588,7 @@ func TestCursor_LeafRootReverse(t *testing.T) { t.Fatal(err) } - c := g.Must(tx.ROBucket([]byte("widgets"))).Cursor() + c := g.Must(tx.ROBucket([]byte("widgets"))).ROCursor() k, v := c.Last() if !bytes.Equal(k, []byte("foo")) { t.Fatalf("unexpected key: %v", k) @@ -2663,7 +2663,7 @@ func TestCursor_Restart(t *testing.T) { t.Fatal(err) } - c := g.Must(tx.ROBucket([]byte("widgets"))).Cursor() + c := g.Must(tx.ROBucket([]byte("widgets"))).ROCursor() k, _ := c.First() if !bytes.Equal(k, []byte("bar")) { @@ -2726,7 +2726,7 @@ func TestCursor_First_EmptyPages(t *testing.T) { } } - c := b.Cursor() + c := b.RWCursor() var n int for k, _ := c.First(); k != nil; k, _ = c.Next() { n++ @@ -2780,7 +2780,7 @@ func TestCursor_QuickCheck(t *testing.T) { t.Fatal(err) } - c := g.Must(tx.ROBucket([]byte("widgets"))).Cursor() + c := g.Must(tx.ROBucket([]byte("widgets"))).ROCursor() for k, v := c.First(); k != nil && index < len(items); @@ -2855,7 +2855,7 @@ func TestCursor_QuickCheck_Reverse(t *testing.T) { t.Fatal(err) } - c := g.Must(tx.ROBucket([]byte("widgets"))).Cursor() + c := g.Must(tx.ROBucket([]byte("widgets"))).ROCursor() for k, v := c.Last(); k != nil && index < len(items); @@ -2925,7 +2925,7 @@ func TestCursor_QuickCheck_BucketsOnly(t *testing.T) { err = db.View(func(snapshot SnapshotI) error { names := []string{} - c := g.Must(snapshot.ROBucket([]byte("widgets"))).Cursor() + c := g.Must(snapshot.ROBucket([]byte("widgets"))).ROCursor() for k, v := c.First(); k != nil; k, v = c.Next() { names = append(names, string(k)) if v != nil { @@ -2979,7 +2979,7 @@ func TestCursor_QuickCheck_BucketsOnly_Reverse(t *testing.T) { err = db.View(func(snapshot SnapshotI) error { names := []string{} - c := g.Must(snapshot.ROBucket([]byte("widgets"))).Cursor() + c := g.Must(snapshot.ROBucket([]byte("widgets"))).ROCursor() for k, v := c.Last(); k != nil; k, v = c.Prev() { names = append(names, string(k)) if v != nil { @@ -3031,7 +3031,7 @@ func ExampleCursor() { } // Create a cursor for iteration. - c := b.Cursor() + c := b.RWCursor() // Iterate over items in sorted key order. This starts from the // first key/value pair and updates the k/v variables to the @@ -3093,7 +3093,7 @@ func ExampleCursor_reverse() { } // Create a cursor for iteration. - c := b.Cursor() + c := b.RWCursor() // Iterate over items in reverse sorted key order. This starts // from the last key/value pair and updates the k/v variables to @@ -4283,7 +4283,7 @@ func ExampleDB_Begin_ReadOnly() { if err != nil { log.Fatal(err) } - c := g.Must(tx.ROBucket([]byte("widgets"))).Cursor() + c := g.Must(tx.ROBucket([]byte("widgets"))).ROCursor() for k, v := c.First(); k != nil; k, v = c.Next() { fmt.Printf("%s likes %s\n", k, v) } @@ -4499,7 +4499,7 @@ func validateBatchBench(b *testing.B, db *WDB) { } } // should be empty now - c := bucket.Cursor() + c := bucket.RWCursor() for k, v := c.First(); k != nil; k, v = c.Next() { b.Errorf("unexpected key: %x = %q", k, v) } @@ -5808,7 +5808,7 @@ func TestTx_Cursor(t *testing.T) { t.Fatal(err) } - c := tx.Cursor() + c := tx.RWCursor() k, v := c.First() if !bytes.Equal(k, []byte("widgets")) { t.Fatalf("unexpected key: %v", k) |