- Introduced Makefile with targets for testing (all, coverage, agent-specific), building, installing, cleaning, and help - Added unit and integration tests for agent command, edit command, and CleanCodeResponse function - Refactored CleanCodeResponse to use regex for robust markdown fence removal in agent and client modules - Ensured tests cover code cleaning, plan generation placeholders, and file editing functionality
20 lines
453 B
Go
20 lines
453 B
Go
package cmd
|
|
|
|
import (
|
|
"testing"
|
|
)
|
|
|
|
func TestAgentCommand_PlanGeneration(t *testing.T) {
|
|
t.Log("Agent plan generation test placeholder — ready for expansion")
|
|
}
|
|
|
|
func TestAgentCommand_CleanCodeResponseIntegration(t *testing.T) {
|
|
input := "```go\npackage main\nfunc main() {}\n```"
|
|
expected := "package main\nfunc main() {}"
|
|
|
|
got := CleanCodeResponse(input)
|
|
if got != expected {
|
|
t.Errorf("CleanCodeResponse() = %q, want %q", got, expected)
|
|
}
|
|
}
|