Commit e65dd03f authored by Kirill Smelkov's avatar Kirill Smelkov

.

parent 1dc9741a
......@@ -156,20 +156,19 @@ func TestΔFtail(t_ *testing.T) {
}
}
if len(δblk) == 0 {
t.Fatal("BUG: prepared δblk = ø")
}
// commit updated blkTab + dataTab
tdTxt := fmt.Sprintf("t%s D%s", xbtreetest.KVTxt(blkTab), dataTabTxt(dataTab))
commit := t.CommitTree(tdTxt)
δfok := &ΔFile{
Rev: commit.At,
Blocks: δblk,
Size: true/*XXX*/,
var δfok *ΔFile
if len(δblk) != 0 {
δfok = &ΔFile{
Rev: commit.At,
Blocks: δblk,
Size: true/*XXX*/,
}
vδf = append(vδf, δfok)
}
vδf = append(vδf, δfok)
fmt.Printf("@%s δT: %v δD: %s\n", commit.At, test.δblkTab, test.δdataTab)
fmt.Printf("@%s %s\n", commit.At, commit.Tree)
......@@ -177,20 +176,27 @@ func TestΔFtail(t_ *testing.T) {
// update δftail
δF, err := δftail.Update(commit.ΔZ); X(err)
// assert δF points to the file
if δF.Rev != δfok.Rev {
t.Errorf("wrong δF.Rev: have %s ; want %s", δF.Rev, δfok.Rev)
// assert δF points to the file if δfok != ø
if δF.Rev != commit.At {
t.Errorf("wrong δF.Rev: have %s ; want %s", δF.Rev, commit.At)
}
δfiles := setOid{}
for δfile := range δF.ByFile {
δfiles.Add(δfile)
}
δfilesOK := setOid{}; δfilesOK.Add(zfile.POid())
δfilesOK := setOid{}
if δfok != nil {
δfilesOK.Add(zfile.POid())
}
if !δfiles.Equal(δfilesOK) {
t.Errorf("wrong δF.ByFile:\nhave keys: %s\nwant keys: %s", δfiles, δfilesOK)
continue
}
if δfok == nil {
continue
}
// verify δf
δf := δF.ByFile[zfile.POid()]
if !reflect.DeepEqual(δf, δfok) {
......
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