aboutsummaryrefslogtreecommitdiffstats
path: root/identity/key_test.go
diff options
context:
space:
mode:
authorMichael Muré <batolettre@gmail.com>2021-01-03 23:59:25 +0100
committerMichael Muré <batolettre@gmail.com>2021-02-14 12:19:00 +0100
commit8d63c983c982f93cc48d3996d6bd097ddeeb327f (patch)
tree94d85594e11965f9780df53a5c0c2b2550c02184 /identity/key_test.go
parent4ef92efeb905102d37b81fafa0ac2173594ef30a (diff)
downloadgit-bug-8d63c983c982f93cc48d3996d6bd097ddeeb327f.tar.gz
WIP
Diffstat (limited to 'identity/key_test.go')
-rw-r--r--identity/key_test.go21
1 files changed, 21 insertions, 0 deletions
diff --git a/identity/key_test.go b/identity/key_test.go
new file mode 100644
index 00000000..3206c34e
--- /dev/null
+++ b/identity/key_test.go
@@ -0,0 +1,21 @@
+package identity
+
+import (
+ "encoding/json"
+ "testing"
+
+ "github.com/stretchr/testify/require"
+)
+
+func TestKeyJSON(t *testing.T) {
+ k := generatePublicKey()
+
+ data, err := json.Marshal(k)
+ require.NoError(t, err)
+
+ var read Key
+ err = json.Unmarshal(data, &read)
+ require.NoError(t, err)
+
+ require.Equal(t, k, &read)
+}