(t *testing.T)
| 313 | } |
| 314 | |
| 315 | func TestQueryLogicalAnd(t *testing.T) { |
| 316 | testQuery(t, func(qt *queryTest) { |
| 317 | id := qt.id |
| 318 | |
| 319 | // foo is sha224-0808f64e60d58979fcb676c96ec938270dea42445aeefcd3a4e6f8db |
| 320 | _, foo := id.UploadFile("file.txt", "foo", time.Unix(1382073153, 0)) |
| 321 | // bar.. is sha224-81d6d49dac1a465f90b0225461a90cc11a5a8675b4457762d52760aa |
| 322 | id.UploadFile("file.txt", "bar..", time.Unix(1382073153, 0)) |
| 323 | |
| 324 | sq := &SearchQuery{ |
| 325 | Constraint: &Constraint{ |
| 326 | Logical: &LogicalConstraint{ |
| 327 | Op: "and", |
| 328 | A: &Constraint{ |
| 329 | BlobRefPrefix: "sha224-08", |
| 330 | }, |
| 331 | B: &Constraint{ |
| 332 | BlobSize: &IntConstraint{ |
| 333 | Max: int64(len("foo")), // excludes "bar.." |
| 334 | }, |
| 335 | }, |
| 336 | }, |
| 337 | }, |
| 338 | } |
| 339 | qt.wantRes(sq, foo) |
| 340 | }) |
| 341 | } |
| 342 | |
| 343 | func TestQueryLogicalXor(t *testing.T) { |
| 344 | testQuery(t, func(qt *queryTest) { |
nothing calls this directly
no test coverage detected