Files
pages/internal/geduldh/boundary_test.go
T
Anya Tokugawa d5d21b7841
Build and publish container images / images (push) Successful in 9m34s
Release container images / release (push) Successful in 36s
Refactor architecture into eight components and consolidate reliability work
Extract Grammaratur, Dregarnuhr, Geduldh, Mestionora, Ordoschnellic, Schutzaria, Kunstzeal and Seheweit behind compatible application contracts.

Include accumulated editor resilience, navigation and theme UX, remote CLI, storage/schema and DR groundwork, tests and design/operations documentation.

Verified: uncached full Go suite; go vet ./...; race tests for all eight components; 11 targeted Chromium tests; Node suites; 19 Python CLI tests; reproducible editor build. No push, release tag or deployment in this checkpoint.
2026-11-01 15:23:31 +09:00

51 lines
1.3 KiB
Go

package geduldh
import (
"go/parser"
"go/token"
"path/filepath"
"reflect"
"strconv"
"strings"
"testing"
)
func TestComponentBoundary(t *testing.T) {
if Component != "geduldh" {
t.Fatal("component identity changed")
}
files, err := filepath.Glob("*.go")
if err != nil {
t.Fatal(err)
}
for _, file := range files {
if strings.HasSuffix(file, "_test.go") {
continue
}
ast, err := parser.ParseFile(token.NewFileSet(), file, nil, parser.ImportsOnly)
if err != nil {
t.Fatal(err)
}
for _, spec := range ast.Imports {
path, err := strconv.Unquote(spec.Path.Value)
if err != nil {
t.Fatal(err)
}
for _, forbidden := range []string{"pageswiki/internal", "database", "net/http"} {
if path == forbidden || strings.HasPrefix(path, forbidden+"/") {
t.Errorf("%s imports %s: payload storage must not own metadata, HTTP, authorization or the compatibility facade", file, path)
}
}
}
}
// Ordinary payload access cannot delete objects or make retention decisions.
contract := reflect.TypeFor[Store]()
var methods []string
for i := 0; i < contract.NumMethod(); i++ {
methods = append(methods, contract.Method(i).Name)
}
if want := []string{"Open", "PutIfAbsent", "Stat", "Verify"}; !reflect.DeepEqual(methods, want) {
t.Fatalf("Document Store contract changed: %v", methods)
}
}