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

Function TestQueryLogicalOr

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

Source from the content-addressed store, hash-verified

287}
288
289func TestQueryLogicalOr(t *testing.T) {
290 testQuery(t, func(qt *queryTest) {
291 id := qt.id
292
293 // foo is sha224-0808f64e60d58979fcb676c96ec938270dea42445aeefcd3a4e6f8db
294 _, foo := id.UploadFile("file.txt", "foo", time.Unix(1382073153, 0))
295 // bar is sha224-07daf010de7f7f0d8d76a76eb8d1eb40182c8d1e7a3877a6686c9bf0
296 _, bar := id.UploadFile("file.txt", "bar", time.Unix(1382073153, 0))
297
298 sq := &SearchQuery{
299 Constraint: &Constraint{
300 Logical: &LogicalConstraint{
301 Op: "or",
302 A: &Constraint{
303 BlobRefPrefix: "sha224-08",
304 },
305 B: &Constraint{
306 BlobRefPrefix: "sha224-07",
307 },
308 },
309 },
310 }
311 qt.wantRes(sq, foo, bar)
312 })
313}
314
315func TestQueryLogicalAnd(t *testing.T) {
316 testQuery(t, func(qt *queryTest) {

Callers

nothing calls this directly

Calls 3

testQueryFunction · 0.85
wantResMethod · 0.80
UploadFileMethod · 0.45

Tested by

no test coverage detected