package index import ( "strings" "testing" ) // Issue 1751: a manifest whose config value falls back to a predefined key (novox/hq ADR 0348) is read by the indexer, so // the module gets its new-form inputs. The manifests are claude-code's, dunst's and xterm's module.json from mesh-catalog // at 835bf22b. func TestAManifestFallingBackToAPredefinedKeyIsRead(t *testing.T) { // 1751 for _, module := range []string{"claude-code", "dunst", "xterm"} { raw := fixture(t, "catalogue-835bf22b-"+module) if !strings.Contains(raw, `"predefined"`) { t.Fatalf("%s: the fixture names no predefined key", module) } in := inputsOf(module, raw, "newtree", nil, func(string) (string, string) { return "src2:" + hex64('1'), "" }) if in.Kept == nil || strings.Contains(in.None2, "cannot be read") { t.Errorf("%s: inputs = %+v, want the manifest read and its inputs kept", module, in) } } } func TestAPredefinedKeyOfAnotherTypeThanItsValueIsStillRefused(t *testing.T) { // 1751: the read judges what it can raw := strings.Replace(fixture(t, "catalogue-835bf22b-xterm"), `"predefined": "font-size"`, `"predefined": "font-size", "trusted": "yes"`, 1) if in := inputsOf("xterm", raw, "newtree", nil, func(string) (string, string) { return "", "none" }); in.Kept != nil { t.Errorf("inputs = %+v, want a manifest the catalogue refuses still refused", in) } }