aboutsummaryrefslogtreecommitdiffstats
path: root/bug/op_set_metadata_test.go
diff options
context:
space:
mode:
Diffstat (limited to 'bug/op_set_metadata_test.go')
-rw-r--r--bug/op_set_metadata_test.go11
1 files changed, 7 insertions, 4 deletions
diff --git a/bug/op_set_metadata_test.go b/bug/op_set_metadata_test.go
index a7f9f313..97e70cf4 100644
--- a/bug/op_set_metadata_test.go
+++ b/bug/op_set_metadata_test.go
@@ -21,16 +21,16 @@ func TestSetMetadata(t *testing.T) {
create.Apply(&snapshot)
snapshot.Operations = append(snapshot.Operations, create)
- hash1, err := create.Hash()
- require.NoError(t, err)
+ hash1 := create.ID()
+ require.True(t, IDIsValid(hash1))
comment := NewAddCommentOp(rene, unix, "comment", nil)
comment.SetMetadata("key2", "value2")
comment.Apply(&snapshot)
snapshot.Operations = append(snapshot.Operations, comment)
- hash2, err := comment.Hash()
- require.NoError(t, err)
+ hash2 := comment.ID()
+ require.True(t, IDIsValid(hash2))
op1 := NewSetMetadataOp(rene, unix, hash1, map[string]string{
"key": "override",
@@ -107,5 +107,8 @@ func TestSetMetadataSerialize(t *testing.T) {
err = json.Unmarshal(data, &after)
assert.NoError(t, err)
+ // enforce creating the ID
+ before.ID()
+
assert.Equal(t, before, &after)
}