aboutsummaryrefslogtreecommitdiff
path: root/lib/util_test.go
diff options
context:
space:
mode:
authorNiall Sheridan <nsheridan@gmail.com>2017-01-05 23:28:26 +0000
committerNiall Sheridan <nsheridan@gmail.com>2017-01-05 23:28:26 +0000
commit9e9a7d50970f1424245d88169de82988fd57e112 (patch)
tree25aca2f5e18fe3ff454af34d5d75f8c5204d81fb /lib/util_test.go
parent8066efd45861e7c024fc1daabc6d002266a527e7 (diff)
Move GetPublicKey to the shared `lib` package
Diffstat (limited to 'lib/util_test.go')
-rw-r--r--lib/util_test.go16
1 files changed, 16 insertions, 0 deletions
diff --git a/lib/util_test.go b/lib/util_test.go
new file mode 100644
index 0000000..9e89297
--- /dev/null
+++ b/lib/util_test.go
@@ -0,0 +1,16 @@
+package lib
+
+import (
+ "testing"
+
+ "github.com/nsheridan/cashier/testdata"
+ "golang.org/x/crypto/ssh"
+)
+
+func TestGetPublicKey(t *testing.T) {
+ t.Parallel()
+ c, _, _, _, _ := ssh.ParseAuthorizedKey(testdata.Cert)
+ if GetPublicKey(c.(*ssh.Certificate)) != string(testdata.Cert) {
+ t.Fail()
+ }
+}