MCPcopy Index your code
hub / github.com/perkeep/perkeep / TestQueryFileCandidateSource

Function TestQueryFileCandidateSource

pkg/search/query_test.go:1117–1135  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

1115}
1116
1117func TestQueryFileCandidateSource(t *testing.T) {
1118 testQueryTypes(t, memIndexTypes, func(qt *queryTest) {
1119 id := qt.id
1120 fileRef, _ := id.UploadFile("some-stuff.txt", "hello", time.Unix(123, 0))
1121 qt.t.Logf("fileRef = %q", fileRef)
1122 p1 := id.NewPlannedPermanode("1")
1123 id.SetAttribute(p1, "camliContent", fileRef.String())
1124
1125 sq := &SearchQuery{
1126 Constraint: &Constraint{
1127 File: &FileConstraint{
1128 WholeRef: blob.RefFromString("hello"),
1129 },
1130 },
1131 }
1132 qt.candidateSource = "corpus_file_meta"
1133 qt.wantRes(sq, fileRef)
1134 })
1135}
1136
1137func TestQueryRecentPermanodes_UnspecifiedSort(t *testing.T) {
1138 testQueryRecentPermanodes(t, UnspecifiedSort, "corpus_permanode_created")

Callers

nothing calls this directly

Calls 8

RefFromStringFunction · 0.92
testQueryTypesFunction · 0.85
LogfMethod · 0.80
NewPlannedPermanodeMethod · 0.80
SetAttributeMethod · 0.80
wantResMethod · 0.80
UploadFileMethod · 0.45
StringMethod · 0.45

Tested by

no test coverage detected