| 1 |
package community |
| 2 |
|
| 3 |
|
| 4 |
|
| 5 |
|
| 6 |
|
| 7 |
|
| 8 |
|
| 9 |
|
| 10 |
|
| 11 |
|
| 12 |
|
| 13 |
|
| 14 |
|
| 15 |
|
| 16 |
|
| 17 |
import ( |
| 18 |
"testing" |
| 19 |
|
| 20 |
"github.com/zmap/zlint/v3/lint" |
| 21 |
"github.com/zmap/zlint/v3/test" |
| 22 |
) |
| 23 |
|
| 24 |
func TestSubjectDNTrailingSpace(t *testing.T) { |
| 25 |
inputPath := "subjectDNTrailingSpace.pem" |
| 26 |
expected := lint.Warn |
| 27 |
out := test.TestLint("w_subject_dn_trailing_whitespace", inputPath) |
| 28 |
if out.Status != expected { |
| 29 |
t.Errorf("%s: expected %s, got %s", inputPath, expected, out.Status) |
| 30 |
} |
| 31 |
} |
| 32 |
|
| 33 |
func TestSubjectDNGood2(t *testing.T) { |
| 34 |
inputPath := "domainValGoodSubject.pem" |
| 35 |
expected := lint.Pass |
| 36 |
out := test.TestLint("w_subject_dn_trailing_whitespace", inputPath) |
| 37 |
if out.Status != expected { |
| 38 |
t.Errorf("%s: expected %s, got %s", inputPath, expected, out.Status) |
| 39 |
} |
| 40 |
} |