Files
archie/internal/gate/gateextract/gateextract_test.go
T
sam e8f78dd0d5 test: regression tests for all audit gaps — 6 enhanced + 4 new packages
Telegram: splitLongMessage (8 cases), isChatAllowed, updateMetadata (4 cases),
  panicRecoveryMiddleware, updateLoggingMiddleware, authorizedMessage, stop-while-stopped
Container: error paths, payload round-trip, overwrite, minimal payload
Events: buffer defaults, subscribe-after-close, double-close safety,
  slow-subscriber isolation, multi-subscriber ordering, publish timestamping
NATS RPC: envelope edge cases, JSON round-trip, request timeout, rollback
NellDB: empty store (6 ops), concurrent enqueue/claim (20 goroutines),
  context cancellation, oversized payload clipping, unmarshalable data,
  status transitions, events ordering, recover stale, clear terminal
Gateway tasks: empty/long title, idempotent enqueue, chat label

New packages with tests (formerly zero-test):
  internal/gate (220 lines), internal/gate/gateextract,
  internal/plugin/pluginextract, internal/workflow/wfextract

All 37 packages pass. Fixes regression gaps from audit.
2026-07-26 10:05:44 +10:00

51 lines
1.2 KiB
Go

package gateextract
import (
"reflect"
"testing"
)
func TestSymbolsContainsExpectedEntries(t *testing.T) {
pkgKey := "github.com/samcharles93/archie-core/internal/gate/gate"
pkg, ok := Symbols[pkgKey]
if !ok {
t.Fatalf("Symbols missing key %q", pkgKey)
}
// Blocking must be a function.
if v, ok := pkg["Blocking"]; !ok {
t.Error("Blocking not found in Symbols")
} else if v.Kind() != reflect.Func {
t.Errorf("Blocking kind = %v, want Func", v.Kind())
}
// Finding must be a pointer type.
if v, ok := pkg["Finding"]; !ok {
t.Error("Finding not found in Symbols")
} else if v.Kind() != reflect.Ptr {
t.Errorf("Finding kind = %v, want Ptr", v.Kind())
}
// GateContext must be a pointer type.
if v, ok := pkg["GateContext"]; !ok {
t.Error("GateContext not found in Symbols")
} else if v.Kind() != reflect.Ptr {
t.Errorf("GateContext kind = %v, want Ptr", v.Kind())
}
}
func TestSymbolsNoUnexpectedEntries(t *testing.T) {
pkgKey := "github.com/samcharles93/archie-core/internal/gate/gate"
pkg := Symbols[pkgKey]
expected := map[string]bool{
"Blocking": true,
"Finding": true,
"GateContext": true,
}
for name := range pkg {
if !expected[name] {
t.Errorf("unexpected symbol %q in gateextract Symbols", name)
}
}
}