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

Function TestBashDefaultsConsistency

pkg/workflow/bash_defaults_consistency_test.go:11–170  ·  view source on GitHub ↗

TestBashDefaultsConsistency tests that Claude and Copilot engines handle default bash tools consistently

(t *testing.T)

Source from the content-addressed store, hash-verified

9
10// TestBashDefaultsConsistency tests that Claude and Copilot engines handle default bash tools consistently
11func TestBashDefaultsConsistency(t *testing.T) {
12 compiler := NewCompiler()
13 claudeEngine := NewClaudeEngine()
14 copilotEngine := NewCopilotEngine()
15
16 tests := []struct {
17 name string
18 tools map[string]any
19 safeOutputs *SafeOutputsConfig
20 }{
21 {
22 name: "empty tools, no safe outputs",
23 tools: map[string]any{},
24 safeOutputs: nil,
25 },
26 {
27 name: "empty tools with create-pull-request safe output",
28 tools: map[string]any{},
29 safeOutputs: &SafeOutputsConfig{
30 CreatePullRequests: &CreatePullRequestsConfig{},
31 },
32 },
33 {
34 name: "bash nil with create-pull-request safe output",
35 tools: map[string]any{
36 "bash": nil,
37 },
38 safeOutputs: &SafeOutputsConfig{
39 CreatePullRequests: &CreatePullRequestsConfig{},
40 },
41 },
42 {
43 name: "bash with star wildcard",
44 tools: map[string]any{
45 "bash": []any{"*"},
46 },
47 safeOutputs: nil,
48 },
49 {
50 name: "bash with colon-star wildcard",
51 tools: map[string]any{
52 "bash": []any{":*"},
53 },
54 safeOutputs: nil,
55 },
56 {
57 name: "bash with empty array (no tools)",
58 tools: map[string]any{
59 "bash": []any{},
60 },
61 safeOutputs: nil,
62 },
63 {
64 name: "bash enabled with true",
65 tools: map[string]any{
66 "bash": true,
67 },
68 safeOutputs: nil,

Callers

nothing calls this directly

Calls 10

applyDefaultToolsMethod · 0.95
NewCompilerFunction · 0.85
NewClaudeEngineFunction · 0.85
NewCopilotEngineFunction · 0.85
NewToolsFunction · 0.85
RunMethod · 0.45
ErrorfMethod · 0.45

Tested by

no test coverage detected