Migrate structural and inspection fixtures
This commit is contained in:
@@ -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"))
|
||||
|
||||
Reference in New Issue
Block a user