aboutsummaryrefslogtreecommitdiffstats
path: root/identity/identity_test.go
diff options
context:
space:
mode:
Diffstat (limited to 'identity/identity_test.go')
-rw-r--r--identity/identity_test.go10
1 files changed, 10 insertions, 0 deletions
diff --git a/identity/identity_test.go b/identity/identity_test.go
index 36d07be6..ad8317ce 100644
--- a/identity/identity_test.go
+++ b/identity/identity_test.go
@@ -204,6 +204,16 @@ func TestMetadata(t *testing.T) {
assertHasKeyValue(t, loaded.ImmutableMetadata(), "key1", "value1")
assertHasKeyValue(t, loaded.MutableMetadata(), "key1", "value2")
+
+ // set metadata after commit
+ versionCount := len(identity.versions)
+ identity.SetMetadata("foo", "bar")
+ require.True(t, identity.NeedCommit())
+ require.Len(t, identity.versions, versionCount+1)
+
+ err = identity.Commit(repo)
+ require.NoError(t, err)
+ require.Len(t, identity.versions, versionCount+1)
}
func assertHasKeyValue(t *testing.T, metadata map[string]string, key, value string) {