Index resolution and origin membership

This commit is contained in:
2026-10-09 03:59:16 +00:00
parent c8546ae599
commit 799ebab5a6
5 changed files with 96 additions and 20 deletions

View File

@@ -122,6 +122,11 @@ func TestResolutionPreservesExplicitNullAndZeroWhileReplacingAbsentBaseline(t *t
func TestResolutionCoalescesEqualAndRepeatedHelperIntent(t *testing.T) {
t.Parallel()
parsedOther, err := ParsePath("/other")
if err != nil {
t.Fatal(err)
}
type config struct {
Value int `yaml:"value"`
Other int `yaml:"other"`
@@ -130,8 +135,9 @@ func TestResolutionCoalescesEqualAndRepeatedHelperIntent(t *testing.T) {
Defaults: func() config { return config{Value: 5} },
Resolve: func(configuration *config, resolution *Resolution) error {
Default(resolution, Keys("value"), &configuration.Value, 5, "equal derived intent", Keys("other"))
Default(resolution, Keys("value"), &configuration.Value, 7, "updated derived intent", Keys("other"))
Default(resolution, Keys("value"), &configuration.Value, 7, "updated derived intent", parsedOther)
Normalize(resolution, Keys("value"), &configuration.Value, 7, "canonicalized value", Keys("other"))
Normalize(resolution, Keys("value"), &configuration.Value, 7, "updated derived intent", parsedOther)
return nil
},
}})