MCPcopy Create free account
hub / github.com/nutsdb/nutsdb / TestIterator_Release

Function TestIterator_Release

iterator_test.go:110–130  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

108}
109
110func TestIterator_Release(t *testing.T) {
111 bucket := "bucket"
112
113 runNutsDBTest(t, nil, func(t *testing.T, db *DB) {
114 txCreateBucket(t, db, DataStructureBTree, bucket, nil)
115
116 for i := 0; i < 100; i++ {
117 txPut(t, db, bucket, testutils.GetTestBytes(i), testutils.GetTestBytes(i), Persistent, nil, nil)
118 }
119
120 _ = db.View(func(tx *Tx) error {
121 iterator := NewIterator(tx, bucket, IteratorOptions{Reverse: true})
122 defer iterator.Release()
123 return nil
124 })
125
126 for i := 0; i < 100; i++ {
127 txDel(t, db, bucket, testutils.GetTestBytes(i), nil)
128 }
129 })
130}
131
132func TestIterator_Item(t *testing.T) {
133 bucket := "bucket"

Callers

nothing calls this directly

Calls 8

ReleaseMethod · 0.95
GetTestBytesFunction · 0.92
runNutsDBTestFunction · 0.85
txCreateBucketFunction · 0.85
txPutFunction · 0.85
NewIteratorFunction · 0.85
txDelFunction · 0.85
ViewMethod · 0.80

Tested by

no test coverage detected