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

Function TestMissingToolSafeOutput

pkg/workflow/missing_tool_test.go:10–116  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

8)
9
10func TestMissingToolSafeOutput(t *testing.T) {
11 tests := []struct {
12 name string
13 frontmatter map[string]any
14 expectConfig bool
15 expectJob bool
16 expectMax int
17 }{
18 {
19 name: "No safe-outputs config should NOT enable missing-tool by default",
20 frontmatter: map[string]any{"name": "Test"},
21 expectConfig: false,
22 expectJob: false,
23 expectMax: 0,
24 },
25 {
26 name: "Safe-outputs with other config should enable missing-tool by default",
27 frontmatter: map[string]any{
28 "name": "Test",
29 "safe-outputs": map[string]any{
30 "create-issue": nil,
31 },
32 },
33 expectConfig: true,
34 expectJob: true,
35 expectMax: 0,
36 },
37 {
38 name: "Explicit missing-tool: false should disable it",
39 frontmatter: map[string]any{
40 "name": "Test",
41 "safe-outputs": map[string]any{
42 "create-issue": nil,
43 "missing-tool": false,
44 },
45 },
46 expectConfig: false,
47 expectJob: false,
48 expectMax: 0,
49 },
50 {
51 name: "Explicit missing-tool config with max",
52 frontmatter: map[string]any{
53 "name": "Test",
54 "safe-outputs": map[string]any{
55 "missing-tool": map[string]any{
56 "max": 5,
57 },
58 },
59 },
60 expectConfig: true,
61 expectJob: true,
62 expectMax: 5,
63 },
64 {
65 name: "Missing-tool with other safe outputs",
66 frontmatter: map[string]any{
67 "name": "Test",

Callers

nothing calls this directly

Calls 6

NewCompilerFunction · 0.85
templatableIntValueFunction · 0.85
RunMethod · 0.45
ErrorfMethod · 0.45
ErrorMethod · 0.45

Tested by

no test coverage detected