localdisk: update failing test's style.

doesn't fix test though.

Change-Id: I5fcca5abbc6b71cfde1a1816b8b8915ca122e644
This commit is contained in:
Brad Fitzpatrick 2013-10-10 17:05:14 -10:00
parent 72021e4516
commit b169d80589
1 changed files with 16 additions and 10 deletions

View File

@ -93,9 +93,9 @@ func TestMultiStat(t *testing.T) {
blobfoo.MustUpload(t, ds)
blobbar.MustUpload(t, ds)
need := make(map[string]bool)
need[blobfoo.BlobRef().String()] = true
need[blobbar.BlobRef().String()] = true
need := make(map[blob.Ref]bool)
need[blobfoo.BlobRef()] = true
need[blobbar.BlobRef()] = true
blobs := []blob.Ref{blobfoo.BlobRef(), blobbar.BlobRef()}
@ -115,14 +115,20 @@ func TestMultiStat(t *testing.T) {
got := 0
for sb := range ch {
got++
br := sb.Ref
brstr := br.String()
Expect(t, need[brstr], "need stat of blobref "+brstr)
delete(need, brstr)
if !need[sb.Ref] {
t.Errorf("didn't need %s", sb.Ref)
}
delete(need, sb.Ref)
}
if want := 2; got != want {
t.Errorf("number stats = %d; want %d", got, want)
}
if err := <-errch; err != nil {
t.Errorf("StatBlobs: %v", err)
}
if len(need) != 0 {
t.Errorf("Not all stat results returned; still need %d", len(need))
}
ExpectInt(t, 2, got, "number stat results")
ExpectNil(t, <-errch, "result from stat")
ExpectInt(t, 0, len(need), "all stat results needed returned")
}
func TestMissingGetReturnsNoEnt(t *testing.T) {