(t *testing.T)
| 1369 | } |
| 1370 | |
| 1371 | func 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 | |
| 1390 | func TestTxn_LowerBound(t *testing.T) { |
| 1391 |