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

Function TestTx_Close

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

Source from the content-addressed store, hash-verified

108}
109
110func TestTx_Close(t *testing.T) {
111 withDefaultDB(t, func(t *testing.T, db *DB) {
112 tx, err := db.Begin(false)
113 assert.NoError(t, err)
114
115 err = tx.Rollback()
116 assert.NoError(t, err)
117
118 bucket := "bucket_tx_close_test"
119
120 _, err = tx.Get(bucket, []byte("foo"))
121 assert.Errorf(t, err, "err TestTx_Close")
122
123 _, err = tx.RangeScan(bucket, []byte("foo0"), []byte("foo1"))
124 assert.Errorf(t, err, "err TestTx_Close")
125
126 _, err = tx.PrefixScan(bucket, []byte("foo"), 0, 1)
127 assert.Errorf(t, err, "err TestTx_Close")
128
129 _, err = tx.PrefixSearchScan(bucket, []byte("f"), "oo", 0, 1)
130 assert.Errorf(t, err, "err TestTx_Close")
131 })
132}
133
134func TestTx_CommittedStatus(t *testing.T) {
135

Callers

nothing calls this directly

Calls 7

withDefaultDBFunction · 0.85
BeginMethod · 0.80
RollbackMethod · 0.80
RangeScanMethod · 0.80
PrefixScanMethod · 0.65
PrefixSearchScanMethod · 0.65
GetMethod · 0.45

Tested by

no test coverage detected