(t *testing.T)
| 1436 | } |
| 1437 | |
| 1438 | func TestQueryChildren(t *testing.T) { |
| 1439 | testQueryTypes(t, memIndexTypes, func(qt *queryTest) { |
| 1440 | id := qt.id |
| 1441 | |
| 1442 | pdir := id.NewPlannedPermanode("some_dir") |
| 1443 | p1 := id.NewPlannedPermanode("1") |
| 1444 | p2 := id.NewPlannedPermanode("2") |
| 1445 | p3 := id.NewPlannedPermanode("3") |
| 1446 | |
| 1447 | id.AddAttribute(pdir, "camliMember", p1.String()) |
| 1448 | id.AddAttribute(pdir, "camliPath:foo", p2.String()) |
| 1449 | id.AddAttribute(pdir, "other", p3.String()) |
| 1450 | |
| 1451 | // Make p1, p2, and p3 actually exist. (permanodes without attributes are dead) |
| 1452 | id.AddAttribute(p1, "x", "x") |
| 1453 | id.AddAttribute(p2, "x", "x") |
| 1454 | id.AddAttribute(p3, "x", "x") |
| 1455 | |
| 1456 | sq := &SearchQuery{ |
| 1457 | Constraint: &Constraint{ |
| 1458 | Permanode: &PermanodeConstraint{ |
| 1459 | Relation: &RelationConstraint{ |
| 1460 | Relation: "parent", |
| 1461 | Any: &Constraint{ |
| 1462 | BlobRefPrefix: pdir.String(), |
| 1463 | }, |
| 1464 | }, |
| 1465 | }, |
| 1466 | }, |
| 1467 | } |
| 1468 | qt.wantRes(sq, p1, p2) |
| 1469 | }) |
| 1470 | } |
| 1471 | |
| 1472 | func TestQueryParent(t *testing.T) { |
| 1473 | testQueryTypes(t, memIndexTypes, func(qt *queryTest) { |
nothing calls this directly
no test coverage detected