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

Function TestGrepToolRemovalCodemod_NoToolsBlock

pkg/cli/codemod_grep_tool_test.go:59–82  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

57}
58
59func TestGrepToolRemovalCodemod_NoToolsBlock(t *testing.T) {
60 codemod := getGrepToolRemovalCodemod()
61
62 content := `---
63on: workflow_dispatch
64permissions:
65 contents: read
66---
67
68# Test Workflow`
69
70 frontmatter := map[string]any{
71 "on": "workflow_dispatch",
72 "permissions": map[string]any{
73 "contents": "read",
74 },
75 }
76
77 result, applied, err := codemod.Apply(content, frontmatter)
78
79 require.NoError(t, err, "Apply should not return an error")
80 assert.False(t, applied, "Codemod should not report changes when tools block doesn't exist")
81 assert.Equal(t, content, result, "Content should remain unchanged")
82}
83
84func TestGrepToolRemovalCodemod_NoGrepField(t *testing.T) {
85 codemod := getGrepToolRemovalCodemod()

Callers

nothing calls this directly

Calls 1

Tested by

no test coverage detected