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

Function TestTxn_Insert_First

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

Source from the content-addressed store, hash-verified

46}
47
48func TestTxn_Insert_First(t *testing.T) {
49 db := testDB(t)
50 txn := db.Txn(true)
51
52 obj := testObj()
53 err := txn.Insert("main", obj)
54 if err != nil {
55 t.Fatalf("err: %v", err)
56 }
57
58 raw, err := txn.First("main", "id", obj.ID)
59 if err != nil {
60 t.Fatalf("err: %v", err)
61 }
62
63 if raw != obj {
64 t.Fatalf("bad: %#v %#v", raw, obj)
65 }
66}
67
68func TestTxn_InsertUpdate_First(t *testing.T) {
69 db := testDB(t)

Callers

nothing calls this directly

Calls 5

testDBFunction · 0.85
testObjFunction · 0.85
TxnMethod · 0.80
InsertMethod · 0.80
FirstMethod · 0.80

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…