From 32a3784a69154c057ef5e53419e5d67adc95fc4d Mon Sep 17 00:00:00 2001 From: "google-labs-jules[bot]" <161369871+google-labs-jules[bot]@users.noreply.github.com> Date: Mon, 18 May 2026 21:21:23 +0000 Subject: [PATCH] test(campaign): add edge case test for max file size in determineAction Co-authored-by: theRebelliousNerd <187437903+theRebelliousNerd@users.noreply.github.com> --- internal/campaign/edge_case_detector_test.go | 20 +++++++++++++++++--- test_plan.txt | 6 ++++++ 2 files changed, 23 insertions(+), 3 deletions(-) create mode 100644 test_plan.txt 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`.