(t *testing.T)
| 124 | } |
| 125 | |
| 126 | func TestIsRunningAsMCPServer(t *testing.T) { |
| 127 | // Save original environment |
| 128 | origMCP := os.Getenv("GH_AW_MCP_SERVER") |
| 129 | defer func() { |
| 130 | os.Setenv("GH_AW_MCP_SERVER", origMCP) |
| 131 | }() |
| 132 | |
| 133 | tests := []struct { |
| 134 | name string |
| 135 | mcpEnv string |
| 136 | expected bool |
| 137 | }{ |
| 138 | { |
| 139 | name: "not in MCP server mode", |
| 140 | mcpEnv: "", |
| 141 | expected: false, |
| 142 | }, |
| 143 | { |
| 144 | name: "in MCP server mode", |
| 145 | mcpEnv: "true", |
| 146 | expected: true, |
| 147 | }, |
| 148 | } |
| 149 | |
| 150 | for _, tt := range tests { |
| 151 | t.Run(tt.name, func(t *testing.T) { |
| 152 | os.Setenv("GH_AW_MCP_SERVER", tt.mcpEnv) |
| 153 | result := isRunningAsMCPServer() |
| 154 | if result != tt.expected { |
| 155 | t.Errorf("isRunningAsMCPServer() = %v, want %v", result, tt.expected) |
| 156 | } |
| 157 | }) |
| 158 | } |
| 159 | } |
| 160 | |
| 161 | func TestGetLastCheckFilePath(t *testing.T) { |
| 162 | path := getLastCheckFilePath() |
nothing calls this directly
no test coverage detected