mirror of
https://blitiri.com.ar/repos/chasquid
synced 2025-12-17 14:37:02 +00:00
dovecot: Include cli-based tests in the coverage tests
Many areas of the dovecot library are tested via chamuyero scripts, but these were not being included in the coverage report. This patch extends the dovecot-auth-cli tests so that they are now coverage-aware.
This commit is contained in:
@@ -6,26 +6,26 @@
|
||||
package main
|
||||
|
||||
import (
|
||||
"flag"
|
||||
"fmt"
|
||||
"os"
|
||||
|
||||
"blitiri.com.ar/go/chasquid/internal/dovecot"
|
||||
)
|
||||
|
||||
func main() {
|
||||
a := dovecot.NewAuth(os.Args[1]+"-userdb", os.Args[1]+"-client")
|
||||
flag.Parse()
|
||||
a := dovecot.NewAuth(flag.Arg(0)+"-userdb", flag.Arg(0)+"-client")
|
||||
|
||||
var ok bool
|
||||
var err error
|
||||
|
||||
switch os.Args[2] {
|
||||
switch flag.Arg(1) {
|
||||
case "exists":
|
||||
ok, err = a.Exists(os.Args[3])
|
||||
ok, err = a.Exists(flag.Arg(2))
|
||||
case "auth":
|
||||
ok, err = a.Authenticate(os.Args[3], os.Args[4])
|
||||
ok, err = a.Authenticate(flag.Arg(2), flag.Arg(3))
|
||||
default:
|
||||
fmt.Printf("unknown subcommand\n")
|
||||
os.Exit(1)
|
||||
}
|
||||
|
||||
if ok {
|
||||
@@ -34,5 +34,4 @@ func main() {
|
||||
}
|
||||
|
||||
fmt.Printf("no: %v\n", err)
|
||||
os.Exit(1)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user