MCPcopy
hub / github.com/perkeep/perkeep / TestQueryPermanodeAttrValueInSet

Function TestQueryPermanodeAttrValueInSet

pkg/search/query_test.go:493–517  ·  view source on GitHub ↗

find a permanode (p2) that has a property being a blobref pointing to a sub-query

(t *testing.T)

Source from the content-addressed store, hash-verified

491// find a permanode (p2) that has a property being a blobref pointing
492// to a sub-query
493func TestQueryPermanodeAttrValueInSet(t *testing.T) {
494 testQuery(t, func(qt *queryTest) {
495 id := qt.id
496
497 p1 := id.NewPlannedPermanode("1")
498 id.SetAttribute(p1, "bar", "baz")
499 p2 := id.NewPlannedPermanode("2")
500 id.SetAttribute(p2, "foo", p1.String())
501
502 sq := &SearchQuery{
503 Constraint: &Constraint{
504 Permanode: &PermanodeConstraint{
505 Attr: "foo",
506 ValueInSet: &Constraint{
507 Permanode: &PermanodeConstraint{
508 Attr: "bar",
509 Value: "baz",
510 },
511 },
512 },
513 },
514 }
515 qt.wantRes(sq, p2)
516 })
517}
518
519// Tests PermanodeConstraint.ValueMatchesInt.
520func TestQueryPermanodeValueMatchesInt(t *testing.T) {

Callers

nothing calls this directly

Calls 5

testQueryFunction · 0.85
NewPlannedPermanodeMethod · 0.80
SetAttributeMethod · 0.80
wantResMethod · 0.80
StringMethod · 0.45

Tested by

no test coverage detected