forked from longtao.wu/droboticflow
20 lines
615 B
Go
20 lines
615 B
Go
package main
|
|
|
|
import (
|
|
"context"
|
|
"errors"
|
|
"go.mongodb.org/mongo-driver/mongo"
|
|
"testing"
|
|
)
|
|
|
|
func TestClassificationNeverExportsConnectionOrCustomerText(t *testing.T) {
|
|
for _, c := range []struct {
|
|
e error
|
|
want string
|
|
}{{context.DeadlineExceeded, "deadline"}, {mongo.CommandError{Code: 40573, Message: "private-address secret"}, "unsupported-topology"}, {mongo.CommandError{Code: 13, Message: "secret"}, "authorization"}, {errors.New("mongodb://private-password@private-address/customer-body"), "connection-or-driver"}} {
|
|
if got := classification(c.e); got != c.want {
|
|
t.Fatal(got, c.want)
|
|
}
|
|
}
|
|
}
|