@@ -57,6 +57,14 @@ func TestMain(m *testing.M) {
5757 os .Exit (code )
5858}
5959
60+ // LEGACY TESTS - These tests are for legacy code that was removed in commit a64726c
61+ // The AddToRepoAndFilesMap and IterateFilesForCopy functions were removed as part of the
62+ // migration to the new pattern-matching system. These tests are commented out but kept for reference.
63+ //
64+ // The new system uses pattern matching rules defined in YAML config files.
65+ // See pattern_matcher_test.go for tests of the new system.
66+
67+ /*
6068func TestAddToRepoAndFilesMap_NewEntry(t *testing.T) {
6169 services.FilesToUpload = nil
6270
@@ -209,6 +217,7 @@ func TestIterateFilesForCopy_RecursiveVsNonRecursive(t *testing.T) {
209217 })
210218 }
211219}
220+ */
212221
213222func TestAddFilesToTargetRepoBranch_Succeeds (t * testing.T ) {
214223 _ = test .WithHTTPMock (t )
@@ -539,10 +548,10 @@ func TestPriority_Strategy_ConfigOverridesEnv_And_MessageFallbacks(t *testing.T)
539548 }
540549
541550 services .FilesToUpload = map [types.UploadKey ]types.UploadFileContent {
542- {RepoName : repo , BranchPath : "refs/heads/" + baseBranch }: {TargetBranch : baseBranch , Content : files },
551+ {RepoName : repo , BranchPath : "refs/heads/" + baseBranch , CommitStrategy : cfg . CopierCommitStrategy }: {TargetBranch : baseBranch , Content : files },
543552 }
544553
545- services .AddFilesToTargetRepoBranch (types. ConfigFileType { cfg })
554+ services .AddFilesToTargetRepoBranch () // No longer takes parameters - uses FilesToUpload map
546555
547556 info := httpmock .GetCallCountInfo ()
548557 require .Equal (t , 1 , info ["GET " + baseRefURL ])
@@ -615,10 +624,10 @@ func TestPriority_PRTitleDefaultsToCommitMessage_And_NoAutoMergeWhenConfigPresen
615624 Name : github .String ("only.txt" ), Path : github .String ("only.txt" ),
616625 Content : github .String (base64 .StdEncoding .EncodeToString ([]byte ("y" ))),
617626 }}
618- cfg := types.Configs {TargetRepo : repo , TargetBranch : baseBranch /* MergeWithoutReview: false (zero value) */ }
619- services .FilesToUpload = map [types.UploadKey ]types.UploadFileContent {{RepoName : repo , BranchPath : "refs/heads/" + baseBranch , RuleName : "" , CommitStrategy : "" }: {TargetBranch : baseBranch , Content : files }}
627+ // cfg := types.Configs{TargetRepo: repo, TargetBranch: baseBranch /* MergeWithoutReview: false (zero value) */}
628+ services .FilesToUpload = map [types.UploadKey ]types.UploadFileContent {{RepoName : repo , BranchPath : "refs/heads/" + baseBranch , RuleName : "" , CommitStrategy : "pr " }: {TargetBranch : baseBranch , Content : files }}
620629
621- services .AddFilesToTargetRepoBranch (types. ConfigFileType { cfg })
630+ services .AddFilesToTargetRepoBranch () // No longer takes parameters - uses FilesToUpload map
622631
623632 // Ensure a PR was created but no merge occurred
624633 require .Equal (t , 1 , test .CountByMethodAndURLRegexp ("POST" , regexp .MustCompile (`/pulls$` )))
0 commit comments