Complete input destination implementation audit
This commit is contained in:
@@ -131,6 +131,25 @@ func TestLayeredDestinationMatchesExplicitlyWrappedInput(t *testing.T) {
|
||||
}
|
||||
}
|
||||
|
||||
func TestEmptyMountedMappingRetainsLowerChildren(t *testing.T) {
|
||||
t.Parallel()
|
||||
|
||||
destination := Keys("collections", "weather")
|
||||
loaded, err := LoadLayered(
|
||||
Input{Source: Bytes("empty-main", []byte("{}\n")), Destination: destination},
|
||||
testSecretBinding(),
|
||||
LayeredOptions[map[string]any]{Underlays: []Underlay{{Inputs: []Input{{
|
||||
Source: Bytes("lower", []byte("prompt: {title: retained}\n")), Destination: destination,
|
||||
}}}}},
|
||||
)
|
||||
if err != nil {
|
||||
t.Fatalf("LoadLayered: %v", err)
|
||||
}
|
||||
if got := layeredMapValue(t, testLoaded(loaded).Config, "collections", "weather", "prompt", "title"); got != "retained" {
|
||||
t.Fatalf("lower child beneath empty mounted mapping = %#v, want retained", got)
|
||||
}
|
||||
}
|
||||
|
||||
func TestLayeredDestinationOverlayRetainsOrdinaryValueSemantics(t *testing.T) {
|
||||
t.Parallel()
|
||||
|
||||
|
||||
Reference in New Issue
Block a user