Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 17 additions & 3 deletions internal/campaign/edge_case_detector_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import (
"context"
"strings"
"testing"
"math"
"time"
)

Expand Down Expand Up @@ -326,6 +327,19 @@ func TestEdgeCaseAnalysis_FileCategories(t *testing.T) {
// Expected behavior: The serial O(N) iteration over facts per file causes an O(N * M) performance cliff.
// Test should define boundaries of acceptable latency.

// TODO: Missing Edge Case - Extreme Values: Max file size boundaries.
// Test determineAction with `LineCount = math.MaxInt32`.
// Expected behavior: Should cleanly suggest ActionModularize without overflow in heuristics (e.g., complexity calc).
func TestEdgeCaseDetector_DetermineAction_MaxLineCount(t *testing.T) {
detector := NewEdgeCaseDetector(nil, nil)
decision := FileDecision{
LineCount: math.MaxInt32,
}

action, reasoning := detector.determineAction(decision)

if action != ActionModularize {
t.Errorf("expected %v, got %v", ActionModularize, action)
}

if reasoning == "" {
t.Errorf("expected reasoning to not be empty")
}
}
6 changes: 6 additions & 0 deletions test_plan.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
1. Read the TODO at the bottom of `internal/campaign/edge_case_detector_test.go` related to `Max file size boundaries`.
2. Add a test function `TestEdgeCaseDetector_DetermineAction_MaxLineCount` to `internal/campaign/edge_case_detector_test.go`.
3. In the test, instantiate `EdgeCaseDetector`.
4. Create a `FileDecision` with `LineCount = math.MaxInt32`.
5. Call `determineAction(decision)` on the detector.
6. Assert that the returned action is `ActionModularize`.