Files
mesh-catalog/modules/mesh-mail/cmd/mesh-mail/sdk_pin_test.go
T

32 lines
1.1 KiB
Go

package main
// The SDK pin a process's own bus connection needs (novox/hq ADR 0436 §4, issue 1172): mesh-mail's go.mod
// requires mesh-sdk go and go 1.26.0, and go/process is importable.
// The blank import below is what proves importability at compile time; go vet (run before every commit, per
// the context file) already fails the build if it is not.
import (
"os"
"strings"
"testing"
_ "git.novox.be/novox/mesh-sdk/go/process"
)
// 1172/AC1, as ADR 0573 sections 2 and 4 hold it: a go.mod names the oldest version a module accepts, the check builds
// the group's own heads whatever it names, so the test no longer reads a release out of the version. It asks that go.mod
// requires mesh-sdk go (at any version) and go 1.26.0, and go/process is importable (the import above).
func TestGoModRequiresTheSDKAndGo(t *testing.T) {
raw, err := os.ReadFile("../../go.mod")
if err != nil {
t.Fatal(err)
}
mod := string(raw)
if !strings.Contains(mod, "git.novox.be/novox/mesh-sdk/go v") {
t.Fatalf("go.mod does not require mesh-sdk go:\n%s", mod)
}
if !strings.Contains(mod, "go 1.26.0") {
t.Fatalf("go.mod does not declare go 1.26.0:\n%s", mod)
}
}