* test: Add test coverage for 16 files (40.3% -> 45.5%) Add comprehensive tests for previously untested packages: - internal/agent/state_test.go - internal/cmd/errors_test.go - internal/crew/types_test.go - internal/doctor/errors_test.go - internal/dog/types_test.go - internal/mail/bd_test.go - internal/opencode/plugin_test.go - internal/rig/overlay_test.go - internal/runtime/runtime_test.go - internal/session/town_test.go - internal/style/style_test.go - internal/ui/markdown_test.go - internal/ui/terminal_test.go - internal/wisp/io_test.go - internal/wisp/types_test.go - internal/witness/types_test.go style_test.go uses func(...string) to match lipgloss variadic Render signature. * fix(lint): remove unused error return from buildCVSummary buildCVSummary always returned nil for its error value, causing golangci-lint to fail with "result 1 (error) is always nil". The function handles errors internally by returning partial data, so the error return was misleading. Removed it and updated caller.
32 lines
759 B
Go
32 lines
759 B
Go
package doctor
|
|
|
|
import (
|
|
"errors"
|
|
"testing"
|
|
)
|
|
|
|
func TestErrCannotFix(t *testing.T) {
|
|
// Test that ErrCannotFix is defined and has expected message
|
|
if ErrCannotFix == nil {
|
|
t.Fatal("ErrCannotFix should not be nil")
|
|
}
|
|
|
|
expected := "check does not support auto-fix"
|
|
if ErrCannotFix.Error() != expected {
|
|
t.Errorf("ErrCannotFix.Error() = %q, want %q", ErrCannotFix.Error(), expected)
|
|
}
|
|
}
|
|
|
|
func TestErrCannotFixIsError(t *testing.T) {
|
|
// Verify ErrCannotFix implements the error interface correctly
|
|
var err error = ErrCannotFix
|
|
if err == nil {
|
|
t.Fatal("ErrCannotFix should implement error interface")
|
|
}
|
|
|
|
// Test errors.Is compatibility
|
|
if !errors.Is(ErrCannotFix, ErrCannotFix) {
|
|
t.Error("errors.Is should return true for ErrCannotFix")
|
|
}
|
|
}
|