From 9e9a7d50970f1424245d88169de82988fd57e112 Mon Sep 17 00:00:00 2001 From: Niall Sheridan Date: Thu, 5 Jan 2017 23:28:26 +0000 Subject: Move GetPublicKey to the shared `lib` package --- lib/util_test.go | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 lib/util_test.go (limited to 'lib/util_test.go') 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() + } +} -- cgit v1.2.3