MCPcopy Create free account
hub / github.com/PerpetualSoftware/pad / assertRestoreSQLiteTuple

Function assertRestoreSQLiteTuple

cmd/pad/cmd_db_restore_test.go:131–141  ·  view source on GitHub ↗
(t *testing.T, path string, want map[string][]byte)

Source from the content-addressed store, hash-verified

129}
130
131func assertRestoreSQLiteTuple(t *testing.T, path string, want map[string][]byte) {
132 t.Helper()
133 got := restoreSQLiteTuple(t, path)
134 for _, suffix := range []string{"", "-wal", "-shm"} {
135 wantData, wantPresent := want[suffix]
136 gotData, gotPresent := got[suffix]
137 if wantPresent != gotPresent || !bytes.Equal(wantData, gotData) {
138 t.Errorf("database%s changed: before=%d bytes, after=%d bytes; presence %v -> %v", suffix, len(wantData), len(gotData), wantPresent, gotPresent)
139 }
140 }
141}
142
143func openRestoreSQLiteCopy(t *testing.T, path string) *sql.DB {
144 t.Helper()

Calls 2

restoreSQLiteTupleFunction · 0.85
HelperMethod · 0.80

Tested by

no test coverage detected