Ensure that a read-write transaction can be retrieved.
(t *testing.T)
| 691 | |
| 692 | // Ensure that a read-write transaction can be retrieved. |
| 693 | func TestDB_BeginRW(t *testing.T) { |
| 694 | db := btesting.MustCreateDB(t) |
| 695 | |
| 696 | tx, err := db.Begin(true) |
| 697 | require.NoError(t, err) |
| 698 | require.NotNil(t, tx, "expected tx") |
| 699 | defer func() { require.NoError(t, tx.Commit()) }() |
| 700 | |
| 701 | require.True(t, tx.Writable(), "expected writable tx") |
| 702 | require.Same(t, db.DB, tx.DB()) |
| 703 | } |
| 704 | |
| 705 | // TestDB_Concurrent_WriteTo checks that issuing WriteTo operations concurrently |
| 706 | // with commits does not produce corrupted db files. It also verifies that all |
nothing calls this directly
no test coverage detected