Add files via upload

This commit is contained in:
公明
2026-08-18 20:29:17 +08:00
committed by GitHub
parent 5eaddd9e8c
commit acc2ebd7e2
96 changed files with 11867 additions and 0 deletions
@@ -0,0 +1,31 @@
package multiagent
import (
"testing"
"cyberstrike-ai/internal/config"
)
func TestAgentMaxIterations(t *testing.T) {
if got := agentMaxIterations(nil); got != defaultAgentMaxIterations {
t.Fatalf("nil cfg: got %d want %d", got, defaultAgentMaxIterations)
}
cfg := &config.Config{Agent: config.AgentConfig{MaxIterations: 12000}}
if got := agentMaxIterations(cfg); got != 12000 {
t.Fatalf("got %d want 12000", got)
}
cfg.Agent.MaxIterations = 0
if got := agentMaxIterations(cfg); got != defaultAgentMaxIterations {
t.Fatalf("zero: got %d want %d", got, defaultAgentMaxIterations)
}
}
func TestResolveMaxIterations(t *testing.T) {
cfg := &config.Config{Agent: config.AgentConfig{MaxIterations: 12000}}
if got := resolveMaxIterations(cfg, 0); got != 12000 {
t.Fatalf("global: got %d want 12000", got)
}
if got := resolveMaxIterations(cfg, 50); got != 50 {
t.Fatalf("override: got %d want 50", got)
}
}