32 lines
1.1 KiB
Go
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 at the release-2 commit (main 34392e7) 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: given mesh-mail's go.mod, when built, then it requires mesh-sdk go at
|
|
// v0.1.14-0.20261019062050-34392e74916c and go 1.26.0, and go/process is importable (the import above).
|
|
func TestGoModPinsTheSDKsProcessRelease(t *testing.T) {
|
|
raw, err := os.ReadFile("../../go.mod")
|
|
if err != nil {
|
|
t.Fatal(err)
|
|
}
|
|
mod := string(raw)
|
|
const wantSDK = "git.novox.be/novox/mesh-sdk/go v0.1.14-0.20261019062050-34392e74916c"
|
|
if !strings.Contains(mod, wantSDK) {
|
|
t.Fatalf("go.mod does not require %q:\n%s", wantSDK, mod)
|
|
}
|
|
if !strings.Contains(mod, "go 1.26.0") {
|
|
t.Fatalf("go.mod does not declare go 1.26.0:\n%s", mod)
|
|
}
|
|
}
|