Files
mesh-delivery/modules/mesh-delivery-indexer/internal/index/predefined_test.go
T
jschoubben ce6c39e46c I6 (5): the judge's tests read the catalogue at the group's head
The captured catalogue beside the judge (testdata/beside) is re-archived from
mesh-catalog 30a3e665 (feat/47-H2, the delivery group's catalogue head), so the
judge's rules are tested against manifests that name their class where they
claim a seat; the catalogue fixtures of judge and internal/index move from
835bf22b and a67f0196 to 30a3e665 (ca-trust refreshed; avahi, audit-logger and
netcheck kept at a67f0196, which they still match). Tested against mesh-sdk
a323a3fd (seatlisttest holds the group's definitions); the build seats' check
now holds current, pause and resume among the verbs the seats' definitions
serve, which have grown since 1887.

Builds: design 47 H2 §814, H-A-428, H-A-452
2026-11-22 02:31:52 +01:00

28 lines
1.3 KiB
Go

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 30a3e665.
func TestAManifestFallingBackToAPredefinedKeyIsRead(t *testing.T) { // 1751
for _, module := range []string{"claude-code", "dunst", "xterm"} {
raw := fixture(t, "catalogue-30a3e665-"+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)
}
}
// A predefined key of another type than its value is still refused: the read judges what it can.
raw := strings.Replace(fixture(t, "catalogue-30a3e665-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)
}
}