MCPcopy Create free account
hub / github.com/github/gh-aw / TestGenerateAllowedToolsComment

Function TestGenerateAllowedToolsComment

pkg/workflow/claude_engine_tools_test.go:550–593  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

548}
549
550func TestGenerateAllowedToolsComment(t *testing.T) {
551 engine := NewClaudeEngine()
552
553 tests := []struct {
554 name string
555 allowedToolsStr string
556 indent string
557 expected string
558 }{
559 {
560 name: "empty allowed tools",
561 allowedToolsStr: "",
562 indent: " ",
563 expected: "",
564 },
565 {
566 name: "single tool",
567 allowedToolsStr: "Bash",
568 indent: " ",
569 expected: " # Allowed tools (sorted):\n # - Bash\n",
570 },
571 {
572 name: "multiple tools",
573 allowedToolsStr: "Bash,Edit,Read",
574 indent: " ",
575 expected: " # Allowed tools (sorted):\n # - Bash\n # - Edit\n # - Read\n",
576 },
577 {
578 name: "tools with special characters",
579 allowedToolsStr: "Bash(echo),mcp__github__issue_read,Write",
580 indent: " ",
581 expected: " # Allowed tools (sorted):\n # - Bash(echo)\n # - mcp__github__issue_read\n # - Write\n",
582 },
583 }
584
585 for _, tt := range tests {
586 t.Run(tt.name, func(t *testing.T) {
587 result := engine.generateAllowedToolsComment(tt.allowedToolsStr, tt.indent)
588 if result != tt.expected {
589 t.Errorf("Expected comment:\n%q\nBut got:\n%q", tt.expected, result)
590 }
591 })
592 }
593}

Callers

nothing calls this directly

Calls 4

NewClaudeEngineFunction · 0.85
RunMethod · 0.45
ErrorfMethod · 0.45

Tested by

no test coverage detected