Commit 0534957b authored by Kirill Smelkov's avatar Kirill Smelkov

.

parent 11bed7a3
......@@ -108,9 +108,19 @@ func testΔFtail(t_ *testing.T, testq chan ΔFTestEntry) {
dataTab[zblki.Name] = zblki.Data
}
xat := map[zodb.Tid]string{} // tid > "at<i>"
// δfstr converts δf to string taking xat into account
δfstr := func(δf *ΔFile) string {
s := fmt.Sprintf("{@%s %s", xat[δf.Rev], δf.Blocks)
if δf.Size {
s += " S"
}
s += "}"
return s
}
i := 0
xat := map[zodb.Tid]string{} // tid > "at<i>"
for test := range testq {
i++
δblk := setI64{}
......@@ -250,7 +260,14 @@ func testΔFtail(t_ *testing.T, testq chan ΔFTestEntry) {
vδf_ok := vδf[j:k+1] // [j,k]
vδf_ := δftail.SliceByFileRev(zfile, lo, hi)
if !reflect.DeepEqual(vδf_, vδf_ok) {
t.Errorf("slice (@%s,@%s]:\nhave: %v\nwant: %v", xat[lo], xat[hi], vδf_, vδf_ok)
var sδf_, sδf_ok []string
for _, δf := range vδf_ {
sδf_ = append(sδf_, δfstr(δf))
}
for _, δf := range vδf_ok {
sδf_ok = append(sδf_ok, δfstr(δf))
}
t.Errorf("slice (@%s,@%s]:\nhave: %v\nwant: %v", xat[lo], xat[hi], sδf_, sδf_ok)
}
}
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment