We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 3e6a544 commit e94bc05Copy full SHA for e94bc05
pkg/postprocess/pem_test.go
@@ -0,0 +1,37 @@
1
+package postprocess
2
+
3
+import "testing"
4
5
+func TestIsPem(t *testing.T) {
6
+ type args struct {
7
+ cc string
8
+ }
9
+ tests := []struct {
10
+ name string
11
+ text []byte
12
+ isSecret bool
13
+ }{
14
+ {
15
+ "Invalid private pem file",
16
+ []byte("Random Binary Data"),
17
+ false,
18
+ },
19
20
21
+ []byte("This is not a pem file."),
22
23
24
25
26
+ []byte("Non-pem File"),
27
28
29
30
+ for _, tt := range tests {
31
+ t.Run(tt.name, func(t *testing.T) {
32
+ if got := IsPrivatePem(tt.text); got != tt.isSecret {
33
+ t.Errorf("TestIsPem() = %v, want %v", got, tt.isSecret)
34
35
+ })
36
37
+}
0 commit comments