MCPcopy
hub / github.com/hashicorp/go-memdb / TestTxn_Defer_Abort

Function TestTxn_Defer_Abort

txn_test.go:1371–1388  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

1369}
1370
1371func TestTxn_Defer_Abort(t *testing.T) {
1372 db := testDB(t)
1373 txn := db.Txn(true)
1374 res := ""
1375
1376 // Defer a function
1377 txn.Defer(func() {
1378 res += "nope"
1379 })
1380
1381 // Commit the txn
1382 txn.Abort()
1383
1384 // Ensure deferred did not run
1385 if res != "" {
1386 t.Fatalf("bad: %q", res)
1387 }
1388}
1389
1390func TestTxn_LowerBound(t *testing.T) {
1391

Callers

nothing calls this directly

Calls 4

testDBFunction · 0.85
TxnMethod · 0.80
DeferMethod · 0.80
AbortMethod · 0.80

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…