diff --git a/cmd/review-bot/main_test.go b/cmd/review-bot/main_test.go index f52099b..4492239 100644 --- a/cmd/review-bot/main_test.go +++ b/cmd/review-bot/main_test.go @@ -902,10 +902,10 @@ func TestMainSubprocess_InvalidRepo(t *testing.T) { if os.Getenv("TEST_SUBPROCESS_MAIN") == "1" { flag.CommandLine = flag.NewFlagSet(os.Args[0], flag.ExitOnError) args := baseSubprocessArgs() - // Replace the canonical --repo with an invalid one. + // Replace the canonical --repo value with an invalid one. for i, a := range args { - if a == "owner/repo" { - args[i] = "invalidrepo" + if a == "--repo" && i+1 < len(args) { + args[i+1] = "invalidrepo" break } } @@ -931,8 +931,8 @@ func TestMainSubprocess_InvalidPRNumber(t *testing.T) { args := baseSubprocessArgs() // Replace the canonical --pr value with a non-numeric string. for i, a := range args { - if a == "1" { - args[i] = "notanumber" + if a == "--pr" && i+1 < len(args) { + args[i+1] = "notanumber" break } }