Close cross-cutting sequence regression gaps

This commit is contained in:
2026-10-16 19:32:31 +00:00
parent adef16ccdd
commit 77c5d9482a
5 changed files with 256 additions and 1 deletions

View File

@@ -17,6 +17,14 @@ func TestSequenceHistoryReplaysAppendAtAssignedIndexes(t *testing.T) {
if len(diagnostics) != 0 {
t.Fatalf("compose diagnostics = %#v", diagnostics)
}
for applicationIndex, application := range composed.applications {
for path, want := range map[string]int{"/records": 1, "/other": 1} {
sequence, present := documentAtPath(application.value, mustParsePath(t, path))
if !present || sequence.Kind != document.Sequence || len(sequence.Sequence) != want {
t.Errorf("application %d retained %s = %#v, %v; want one source fragment item", applicationIndex, path, sequence, present)
}
}
}
working := parseCompositionDocument(t, "defaults", "records: [{id: default}]\nother: [{id: default}]\n")
index := new(mappingIndex)