MCPcopy
hub / github.com/perkeep/perkeep / newSorted

Function newSorted

pkg/index/sqlite/sqlite_test.go:37–54  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

35)
36
37func newSorted(t *testing.T) (kv sorted.KeyValue, clean func()) {
38 f, err := os.CreateTemp("", "sqlite-test")
39 if err != nil {
40 t.Fatal(err)
41 }
42
43 kv, err = sorted.NewKeyValue(jsonconfig.Obj{
44 "type": "sqlite",
45 "file": f.Name(),
46 })
47 if err != nil {
48 t.Fatal(err)
49 }
50 return kv, func() {
51 kv.Close()
52 os.Remove(f.Name())
53 }
54}
55
56func TestSorted_SQLite(t *testing.T) {
57 kv, clean := newSorted(t)

Callers 4

TestSorted_SQLiteFunction · 0.85
testMethod · 0.85
TestConcurrencyFunction · 0.85
TestFDLeakFunction · 0.85

Calls 5

NewKeyValueFunction · 0.92
FatalMethod · 0.80
NameMethod · 0.65
CloseMethod · 0.65
RemoveMethod · 0.65

Tested by

no test coverage detected