Skip to content

Commit 56e0720

Browse files
committed
Add test for native SSH key parser
Without this patch, the native SSH key parser is not tested. Signed-off-by: Leon M. Busch-George <[email protected]>
1 parent 14ccebe commit 56e0720

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

models/asymkey/ssh_key_test.go

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,14 @@ func Test_SSHParsePublicKey(t *testing.T) {
5757
assert.Equal(t, tc.keyType, keyTypeK)
5858
assert.EqualValues(t, tc.length, lengthK)
5959
})
60+
t.Run("SSHParseKeyNative", func(t *testing.T) {
61+
keyTypeK, lengthK, err := SSHNativeParsePublicKey(tc.content)
62+
if err != nil {
63+
assert.Fail(t, "%v", err)
64+
}
65+
assert.Equal(t, tc.keyType, keyTypeK)
66+
assert.EqualValues(t, tc.length, lengthK)
67+
})
6068
})
6169
}
6270
}

0 commit comments

Comments
 (0)