Skip to content

Commit

Permalink
asserting human readable strings is error prone (#707)
Browse files Browse the repository at this point in the history
  • Loading branch information
christopher-henderson committed Mar 12, 2023
1 parent c7740fa commit 5ed8e34
Showing 1 changed file with 9 additions and 16 deletions.
25 changes: 9 additions & 16 deletions v3/lints/rfc/lint_ext_duplicate_extension_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,22 +23,19 @@ import (

func TestDuplicateExtensions(t *testing.T) {
testCases := []struct {
name string
path string
expectedStatus lint.LintStatus
expectedDetails string
name string
path string
expectedStatus lint.LintStatus
}{
{
name: "duplicate SAN extension",
path: "extSANDuplicated.pem",
expectedStatus: lint.Error,
expectedDetails: "The following extensions are duplicated: 2.5.29.17",
name: "duplicate SAN extension",
path: "extSANDuplicated.pem",
expectedStatus: lint.Error,
},
{
name: "multiple duplicate extensions",
path: "multDupeExts.pem",
expectedStatus: lint.Error,
expectedDetails: "The following extensions are duplicated: 2.5.29.14, 2.5.29.35",
name: "multiple duplicate extensions",
path: "multDupeExts.pem",
expectedStatus: lint.Error,
},
{
name: "no duplicate extensions",
Expand All @@ -56,10 +53,6 @@ func TestDuplicateExtensions(t *testing.T) {
t.Errorf("%s: expected status %q got %q",
tc.path, tc.expectedStatus, actual.Status)
}
if actual.Details != tc.expectedDetails {
t.Errorf("%s: expected detail %q got %q",
tc.path, tc.expectedDetails, actual.Details)
}
})
}
}

0 comments on commit 5ed8e34

Please sign in to comment.