(t *testing.T)
| 436 | } |
| 437 | |
| 438 | func TestQueryPermanodeAttrNumValue(t *testing.T) { |
| 439 | testQuery(t, func(qt *queryTest) { |
| 440 | id := qt.id |
| 441 | |
| 442 | // TODO(bradfitz): if we set an empty attribute value here and try to search |
| 443 | // by NumValue IntConstraint Min = 1, it fails only in classic (no corpus) mode. |
| 444 | // Something there must be skipping empty values. |
| 445 | p1 := id.NewPlannedPermanode("1") |
| 446 | id.AddAttribute(p1, "x", "1") |
| 447 | id.AddAttribute(p1, "x", "2") |
| 448 | p2 := id.NewPlannedPermanode("2") |
| 449 | id.AddAttribute(p2, "x", "1") |
| 450 | id.AddAttribute(p2, "x", "2") |
| 451 | id.AddAttribute(p2, "x", "3") |
| 452 | |
| 453 | sq := &SearchQuery{ |
| 454 | Constraint: &Constraint{ |
| 455 | Permanode: &PermanodeConstraint{ |
| 456 | Attr: "x", |
| 457 | NumValue: &IntConstraint{ |
| 458 | Min: 3, |
| 459 | }, |
| 460 | }, |
| 461 | }, |
| 462 | } |
| 463 | qt.wantRes(sq, p2) |
| 464 | }) |
| 465 | } |
| 466 | |
| 467 | // Tests that NumValue queries with ZeroMax return permanodes without any values. |
| 468 | func TestQueryPermanodeAttrNumValueZeroMax(t *testing.T) { |
nothing calls this directly
no test coverage detected