From 50258215b40f3a252fccb83e1487b53b63556156 Mon Sep 17 00:00:00 2001 From: jochen Date: Thu, 5 Nov 2026 12:47:46 +0100 Subject: [PATCH] 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 --- go/seatdef/seatdef_test.go | 12 ------------ go/seatdef/templates_test.go | 20 ++++++++++++++++++++ 2 files changed, 20 insertions(+), 12 deletions(-) create mode 100644 go/seatdef/templates_test.go diff --git a/go/seatdef/seatdef_test.go b/go/seatdef/seatdef_test.go index fccd43b..43881f4 100644 --- a/go/seatdef/seatdef_test.go +++ b/go/seatdef/seatdef_test.go @@ -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) - } -} diff --git a/go/seatdef/templates_test.go b/go/seatdef/templates_test.go new file mode 100644 index 0000000..88bac53 --- /dev/null +++ b/go/seatdef/templates_test.go @@ -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) + } +}