Retain matched resolution evidence in history
This commit is contained in:
@@ -117,10 +117,26 @@ func TestResolutionAuditsRegisteredCollectionChanges(t *testing.T) {
|
||||
t.Fatal(err)
|
||||
}
|
||||
if test.move {
|
||||
correspondence := result.history.resolutionPayload.correspondence
|
||||
entry, ok := correspondence.entryPath(Keys("items").Index(1).Key("value"))
|
||||
if !ok || entry.String() != "/items/0/value" {
|
||||
t.Fatalf("retained entry = %s, %t", entry.String(), ok)
|
||||
}
|
||||
for _, snapshot := range result.history.resolutionPayload.snapshots {
|
||||
if snapshot.change.Path.String() == "/items/1/value" && (snapshot.before == nil || snapshot.before.Text != "old") {
|
||||
if snapshot.change.Path.String() == "/items/1/value" && (snapshot.before == nil || snapshot.before.Text != "old" || !snapshot.hasEntry || snapshot.entryPath.String() != "/items/0/value") {
|
||||
t.Fatalf("paired before = %#v", snapshot.before)
|
||||
}
|
||||
if snapshot.before != nil {
|
||||
found := false
|
||||
for _, root := range result.history.documentRoots() {
|
||||
if root == snapshot.before {
|
||||
found = true
|
||||
}
|
||||
}
|
||||
if !found {
|
||||
t.Fatal("paired snapshot omitted from retained roots")
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return
|
||||
|
||||
Reference in New Issue
Block a user