MCPcopy Create free account
hub / github.com/atripati/ark / TestEngineBasicPrepare

Function TestEngineBasicPrepare

pkg/context/engine_test.go:10–35  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

8)
9
10func TestEngineBasicPrepare(t *testing.T) {
11 mgr := NewManager(DefaultBudget(200000))
12 registerTestTools(mgr)
13
14 engine := NewEngine(mgr, DefaultEngineConfig())
15 plan := engine.PrepareContext("task-1", "create a pull request on github")
16
17 if plan == nil {
18 t.Fatal("PrepareContext returned nil")
19 }
20 if plan.Attempt != 1 {
21 t.Errorf("expected attempt 1, got %d", plan.Attempt)
22 }
23 if plan.Strategy != "minimal" {
24 t.Errorf("expected strategy 'minimal', got %s", plan.Strategy)
25 }
26 if len(plan.ToolsLoaded) == 0 {
27 t.Error("expected at least 1 tool loaded")
28 }
29 if len(plan.ToolsLoaded) > 3 {
30 t.Errorf("initial load should be ≤3 tools (config), got %d", len(plan.ToolsLoaded))
31 }
32
33 t.Logf("Plan: %d tools loaded, %d tokens, strategy=%s",
34 len(plan.ToolsLoaded), plan.TokensUsed, plan.Strategy)
35}
36
37func TestEngineExpandOnFailure(t *testing.T) {
38 mgr := NewManager(DefaultBudget(200000))

Callers

nothing calls this directly

Calls 7

PrepareContextMethod · 0.95
NewManagerFunction · 0.85
DefaultBudgetFunction · 0.85
registerTestToolsFunction · 0.85
NewEngineFunction · 0.85
DefaultEngineConfigFunction · 0.85
ErrorMethod · 0.80

Tested by

no test coverage detected