§626 (teller, bridge, runner, watchman): the own-module guards are folded into an existing test each
The four TestNoCode...OwnModule functions became helpers called by TestTheNamesAreTheManifests, TestMergeCallsTheToolOnceAndWritesTheMergedMessage, TestTools and TestNoTickerTimerOrSleep, so no module ends with more tests than its merge base for them. Builds: design 47 G §626, §428, A-296 Claude-Session: https://claude.ai/code/session_01NcbgfGKaxw984XyAPfLm4h
This commit is contained in:
@@ -183,6 +183,7 @@ func TestTreesRefusedLeavesTheEventForTenSecondsAndLogs(t *testing.T) { // 1236/
|
||||
// is taken by the seat's verb branch, never the event's head, written once as merged with its pull request and base, and
|
||||
// its head kept, so the same move heard again writes nothing; a move of a branch not watched writes nothing.
|
||||
func TestMergeCallsTheToolOnceAndWritesTheMergedMessage(t *testing.T) {
|
||||
noCodeNamesTheBridgesOwnModule(t)
|
||||
var logs bytes.Buffer
|
||||
var keys []string
|
||||
var args []any
|
||||
|
||||
@@ -12,9 +12,9 @@ import (
|
||||
// The tests run the bridge as the module its manifest names, as its credential would say it.
|
||||
func init() { setForgeBridgeModule("mesh-delivery-forge-bridge") }
|
||||
|
||||
// No code of the bridge names its own module: its buckets, its stream's subjects and its finding observer take the module its
|
||||
// Held by the test that calls it (§626: no new test function). No code of the bridge names its own module: its buckets, its stream's subjects and its finding observer take the module its
|
||||
// credential (or the runtime that serves its tools) names (design 47 G A-296, §428). The manifest alone says it.
|
||||
func TestNoCodeNamesTheBridgesOwnModule(t *testing.T) {
|
||||
func noCodeNamesTheBridgesOwnModule(t *testing.T) {
|
||||
name := regexp.MustCompile(`"mesh-delivery-forge-bridge(_[^"]*)?"`)
|
||||
err := filepath.WalkDir("../..", func(path string, d fs.DirEntry, err error) error {
|
||||
if err != nil || d.IsDir() || !strings.HasSuffix(path, ".go") || strings.HasSuffix(path, "_test.go") {
|
||||
|
||||
@@ -24,6 +24,7 @@ func (none) Value(string) (json.RawMessage, error) { return nil, nil }
|
||||
// TestTools: the bundle serves the five read verbs as <seat>.<verb> (§83, §306; RN15/AC1), and the first-view tools
|
||||
// (§77, §200; RN2/AC4), named with the prefix runner_ (§539; RN25).
|
||||
func TestTools(t *testing.T) {
|
||||
noCodeNamesTheRunnersOwnModule(t)
|
||||
var names []string
|
||||
for _, tl := range Tools(pipeline.Reads{Pipelines: none{}, Kept: none{}}) {
|
||||
names = append(names, tl.Name)
|
||||
|
||||
@@ -9,9 +9,9 @@ import (
|
||||
"testing"
|
||||
)
|
||||
|
||||
// No code of the pipeline runner names its own module: its tools' first views and its buckets take the module its credential (or
|
||||
// Held by the test that calls it (§626: no new test function). No code of the pipeline runner names its own module: its tools' first views and its buckets take the module its credential (or
|
||||
// the runtime that serves its tools) names (design 47 G A-296, §428). The manifest alone says it.
|
||||
func TestNoCodeNamesTheRunnersOwnModule(t *testing.T) {
|
||||
func noCodeNamesTheRunnersOwnModule(t *testing.T) {
|
||||
name := regexp.MustCompile(`"mesh-delivery-pipeline(_[^"]*)?"`)
|
||||
err := filepath.WalkDir("../..", func(path string, d fs.DirEntry, err error) error {
|
||||
if err != nil || d.IsDir() || !strings.HasSuffix(path, ".go") || strings.HasSuffix(path, "_test.go") {
|
||||
|
||||
@@ -16,6 +16,7 @@ import (
|
||||
// and consumes, its own states answers and teller-marks, no `reads`), since no contract names a holder (novox/hq ADR 0634 §1;
|
||||
// design 47 G §653, A-175, A-178).
|
||||
func TestTheNamesAreTheManifests(t *testing.T) {
|
||||
noCodeNamesTheTellersOwnModule(t)
|
||||
raw, err := os.ReadFile("../../module.json")
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
|
||||
@@ -13,9 +13,9 @@ import (
|
||||
// by TestTheNamesAreTheManifests.
|
||||
const tellerModule = "mesh-delivery-teller"
|
||||
|
||||
// No code of the teller names its own module: its buckets, its conditions, its asks' subjects and its tools' first views take
|
||||
// Held by the test that calls it (§626: no new test function). No code of the teller names its own module: its buckets, its conditions, its asks' subjects and its tools' first views take
|
||||
// the module its credential (or the runtime that serves its tools) names (design 47 G A-296, §428). The manifest alone says it.
|
||||
func TestNoCodeNamesTheTellersOwnModule(t *testing.T) {
|
||||
func noCodeNamesTheTellersOwnModule(t *testing.T) {
|
||||
name := regexp.MustCompile(`"` + regexp.QuoteMeta(tellerModule) + `(_[^"]*)?"`)
|
||||
err := filepath.WalkDir("../..", func(path string, d fs.DirEntry, err error) error {
|
||||
if err != nil || d.IsDir() || !strings.HasSuffix(path, ".go") || strings.HasSuffix(path, "_test.go") {
|
||||
|
||||
@@ -238,6 +238,7 @@ func TestManifestResources(t *testing.T) { // 1135/AC6
|
||||
}
|
||||
|
||||
func TestNoTickerTimerOrSleep(t *testing.T) { // 1135/AC7
|
||||
noCodeNamesTheWatchmansOwnModule(t)
|
||||
forbidden := []string{"time.Tick", "time.NewTicker", "time.Sleep", "time.After", "time.NewTimer", "time.AfterFunc"}
|
||||
var files int
|
||||
for _, root := range []string{"cmd", "internal"} {
|
||||
|
||||
@@ -9,9 +9,9 @@ import (
|
||||
"testing"
|
||||
)
|
||||
|
||||
// No code of the watchman names its own module: its buckets, its consumer, its finding observer and its tools' names take the
|
||||
// Held by the test that calls it (§626: no new test function). No code of the watchman names its own module: its buckets, its consumer, its finding observer and its tools' names take the
|
||||
// module its credential (or the runtime that serves its tools) names (design 47 G A-296, §428). The manifest alone says it.
|
||||
func TestNoCodeNamesTheWatchmansOwnModule(t *testing.T) {
|
||||
func noCodeNamesTheWatchmansOwnModule(t *testing.T) {
|
||||
name := regexp.MustCompile(`"` + regexp.QuoteMeta(watchmanModule) + `(_[^"]*)?"`)
|
||||
err := filepath.WalkDir(".", func(path string, d fs.DirEntry, err error) error {
|
||||
if err != nil || d.IsDir() || !strings.HasSuffix(path, ".go") || strings.HasSuffix(path, "_test.go") {
|
||||
|
||||
Reference in New Issue
Block a user