Files
nofx/decision/prompt_test.go
T
2025-12-08 01:43:22 +08:00

30 lines
677 B
Go

package decision
import (
"strings"
"testing"
)
// TestBuildSystemPrompt_ContainsAllValidActions tests whether prompt contains all valid actions
func TestBuildSystemPrompt_ContainsAllValidActions(t *testing.T) {
// These are all valid actions defined in the system (from validateDecision)
validActions := []string{
"open_long",
"open_short",
"close_long",
"close_short",
"hold",
"wait",
}
// Build prompt
prompt := buildSystemPrompt(1000.0, 10, 5, "default", "")
// Verify each valid action appears in prompt
for _, action := range validActions {
if !strings.Contains(prompt, action) {
t.Errorf("Prompt missing valid action: %s", action)
}
}
}