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