diff --git a/internal/campaign/edge_case_detector_test.go b/internal/campaign/edge_case_detector_test.go index 30bceb09..ebf5e648 100644 --- a/internal/campaign/edge_case_detector_test.go +++ b/internal/campaign/edge_case_detector_test.go @@ -4,6 +4,7 @@ import ( "context" "strings" "testing" + "math" "time" ) @@ -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") + } +} diff --git a/test_plan.txt b/test_plan.txt new file mode 100644 index 00000000..932b6789 --- /dev/null +++ b/test_plan.txt @@ -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`.