Compare commits
2 Commits
d3b9027da3
...
89596516d7
| Author | SHA1 | Date | |
|---|---|---|---|
| 89596516d7 | |||
| 282b6e0e86 |
@@ -903,12 +903,17 @@ func TestMainSubprocess_InvalidRepo(t *testing.T) {
|
||||
flag.CommandLine = flag.NewFlagSet(os.Args[0], flag.ExitOnError)
|
||||
args := baseSubprocessArgs()
|
||||
// Replace the canonical --repo value with an invalid one.
|
||||
found := false
|
||||
for i, a := range args {
|
||||
if a == "--repo" && i+1 < len(args) {
|
||||
args[i+1] = "invalidrepo"
|
||||
found = true
|
||||
break
|
||||
}
|
||||
}
|
||||
if !found {
|
||||
t.Fatal("baseSubprocessArgs() does not contain --repo; test is broken")
|
||||
}
|
||||
os.Args = args
|
||||
main()
|
||||
return
|
||||
@@ -930,12 +935,17 @@ func TestMainSubprocess_InvalidPRNumber(t *testing.T) {
|
||||
flag.CommandLine = flag.NewFlagSet(os.Args[0], flag.ExitOnError)
|
||||
args := baseSubprocessArgs()
|
||||
// Replace the canonical --pr value with a non-numeric string.
|
||||
found := false
|
||||
for i, a := range args {
|
||||
if a == "--pr" && i+1 < len(args) {
|
||||
args[i+1] = "notanumber"
|
||||
found = true
|
||||
break
|
||||
}
|
||||
}
|
||||
if !found {
|
||||
t.Fatal("baseSubprocessArgs() does not contain --pr; test is broken")
|
||||
}
|
||||
os.Args = args
|
||||
main()
|
||||
return
|
||||
|
||||
Reference in New Issue
Block a user