Seatdef: the templates test moves to an external test package, the catalogue now reads definitions (issue 1966)

Claude-Session: https://claude.ai/code/session_01JG73KJNrH5EgFXMKKYSrig
This commit is contained in:
2026-11-05 12:47:46 +01:00
parent 651c28e70d
commit 50258215b4
2 changed files with 20 additions and 12 deletions
-12
View File
@@ -4,8 +4,6 @@ import (
"errors"
"strings"
"testing"
"git.novox.be/novox/mesh-sdk/go/catalogue"
)
// TestADefinitionIsReadStrictlyNamingWhatIsWrong is the format's own table (design 26: a valid definition parses;
@@ -149,13 +147,3 @@ func withState(def, state string) string {
}
return strings.Replace(def, `"decision":"ADR 1",`, `"decision":"ADR 1","states":[`+state+`],`, 1)
}
// TestTheTemplatesAreTheCataloguesSix holds this reader's list of templates equal to the one a module's `requires`
// entry takes (ADR 0595 §2), so a seventh template cannot be added to one and not the other.
func TestTheTemplatesAreTheCataloguesSix(t *testing.T) {
want := []string{catalogue.TemplateState, catalogue.TemplateEvents, catalogue.TemplateWorkQueue,
catalogue.TemplateLog, catalogue.TemplateObjects, catalogue.TemplateLedger}
if strings.Join(Templates, ",") != strings.Join(want, ",") {
t.Errorf("templates %v, the catalogue's %v", Templates, want)
}
}
+20
View File
@@ -0,0 +1,20 @@
package seatdef_test
import (
"strings"
"testing"
"git.novox.be/novox/mesh-sdk/go/catalogue"
"git.novox.be/novox/mesh-sdk/go/seatdef"
)
// (An external test: the catalogue reads definitions, so seatdef's own tests cannot import it.)
// TestTheTemplatesAreTheCataloguesSix holds this reader's list of templates equal to the one a module's `requires`
// entry takes (ADR 0595 §2), so a seventh template cannot be added to one and not the other.
func TestTheTemplatesAreTheCataloguesSix(t *testing.T) {
want := []string{catalogue.TemplateState, catalogue.TemplateEvents, catalogue.TemplateWorkQueue,
catalogue.TemplateLog, catalogue.TemplateObjects, catalogue.TemplateLedger}
if strings.Join(seatdef.Templates, ",") != strings.Join(want, ",") {
t.Errorf("templates %v, the catalogue's %v", seatdef.Templates, want)
}
}