Migrate structural and inspection fixtures

This commit is contained in:
2026-11-02 00:42:41 +00:00
parent 54bdc24865
commit eb87a10e1c
23 changed files with 140 additions and 81 deletions

View File

@@ -71,6 +71,21 @@ func TestSiblingInheritanceResolvesReferencesAndKeepsInputs(t *testing.T) {
}
}
func TestSiblingInheritancePreservesNestedConfigData(t *testing.T) {
input := parseCompositionDocument(t, "source-1", "parent: {config: {enabled: false, count: 0, empty: '', optional: null}}\nchild: {extends: parent}\n")
result, diagnostics := expandSiblingDefinitions(input, Path{})
if len(diagnostics) != 0 {
t.Fatal(diagnostics)
}
for _, key := range []string{"enabled", "count", "empty", "optional"} {
parent, ok := documentAtPath(result.root, Keys("parent", "config", key))
child, found := documentAtPath(result.root, Keys("child", "config", key))
if !ok || !found || parent.Kind != child.Kind || parent.Text != child.Text {
t.Fatalf("inherited %s = %#v, parent = %#v", key, child, parent)
}
}
}
func TestSiblingInheritanceTracksTransferAndIndependentChildren(t *testing.T) {
input := parseCompositionDocument(t, "source-1", "first: {value: parent}\nsecond: {extends: first}\nthird: {extends: first}\n")
result, diagnostics := expandSiblingDefinitions(input, Keys("catalog"))