(t *testing.T)
| 178 | } |
| 179 | |
| 180 | func TestHandleGatewayCommand_Dispatch(t *testing.T) { |
| 181 | t.Setenv("HOME", t.TempDir()) |
| 182 | for _, e := range []string{"CHATCLI_TELEGRAM_BOT_TOKEN", "CHATCLI_DISCORD_BOT_TOKEN", "CHATCLI_SLACK_ADDR", "CHATCLI_WHATSAPP_ADDR", "CHATCLI_WEBHOOK_ADDR"} { |
| 183 | t.Setenv(e, "") |
| 184 | } |
| 185 | c := &ChatCLI{logger: zap.NewNop()} |
| 186 | // Each branch must dispatch without panicking. |
| 187 | c.handleGatewayCommand("/gateway") // -> start (no adapters) |
| 188 | c.handleGatewayCommand("/gateway status") // -> status |
| 189 | c.handleGatewayCommand("/gateway stop") // -> stop (not running) |
| 190 | c.handleGatewayCommand("/gateway nope") // -> usage |
| 191 | } |
| 192 | |
| 193 | func TestGatewayStartDetached_AlreadyRunning(t *testing.T) { |
| 194 | tmp := t.TempDir() |
nothing calls this directly
no test coverage detected