prober: fix test logic (#15952)

Catch failing tests that have no expected error string.

Updates #15912

Signed-off-by: Mike O'Driscoll <mikeo@tailscale.com>
This commit is contained in:
Mike O'Driscoll 2025-05-13 09:19:18 -04:00 committed by GitHub
parent 65e005ccaa
commit fccba5a2f1
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -252,7 +252,7 @@ func TestCRL(t *testing.T) {
"NoCRL",
leafCertParsed,
nil,
"",
"no CRL server presented in leaf cert for",
},
{
"NotBeforeCRLStaplingDate",
@ -276,7 +276,7 @@ func TestCRL(t *testing.T) {
return
}
if err == nil || !strings.Contains(err.Error(), tt.wantErr) {
if err == nil || tt.wantErr == "" || !strings.Contains(err.Error(), tt.wantErr) {
t.Errorf("unexpected error %q; want %q", err, tt.wantErr)
}
})