agent/cmd/mcp/ethics_test.go
Snider e90a84eaa0 feat: merge go-agent + go-agentic + php-devops into unified agent repo
Combines three repositories into a single workspace:
- go-agent → pkg/orchestrator (Clotho), pkg/jobrunner, pkg/loop, cmd/
- go-agentic → pkg/lifecycle (allowance, sessions, plans, dispatch)
- php-devops → repos.yaml, setup.sh, scripts/, .core/

Module path: forge.lthn.ai/core/agent

All packages build, all tests pass.

Co-Authored-By: Virgil <virgil@lethean.io>
2026-03-06 15:23:00 +00:00

37 lines
764 B
Go

package main
import (
"os"
"path/filepath"
"testing"
)
func TestEthicsCheck_Good(t *testing.T) {
root, err := findRepoRoot()
if err != nil {
t.Fatalf("expected repo root: %v", err)
}
modalPath := filepath.Join(root, ethicsModalPath)
modal, err := os.ReadFile(modalPath)
if err != nil {
t.Fatalf("expected modal to read: %v", err)
}
if len(modal) == 0 {
t.Fatalf("expected modal content")
}
axioms, err := readJSONMap(filepath.Join(root, ethicsAxiomsPath))
if err != nil {
t.Fatalf("expected axioms to read: %v", err)
}
if len(axioms) == 0 {
t.Fatalf("expected axioms data")
}
}
func TestReadJSONMap_Bad(t *testing.T) {
if _, err := readJSONMap("/missing/file.json"); err == nil {
t.Fatalf("expected error for missing json")
}
}