aboutsummaryrefslogtreecommitdiffstats
path: root/bug/operation_pack_test.go
diff options
context:
space:
mode:
authorMichael Muré <batolettre@gmail.com>2019-01-20 15:41:27 +0100
committerMichael Muré <batolettre@gmail.com>2019-03-01 22:40:22 +0100
commit14b240af8fef269d2c1d5dde2fff192b656c50f3 (patch)
tree4f6ea032789d811cd019bbb6c190c99a650084b2 /bug/operation_pack_test.go
parentd10c76469d40f13e27739fd363145e89bf74c3e0 (diff)
downloadgit-bug-14b240af8fef269d2c1d5dde2fff192b656c50f3.tar.gz
identity: more cleaning and fixes after a code review
Diffstat (limited to 'bug/operation_pack_test.go')
-rw-r--r--bug/operation_pack_test.go25
1 files changed, 7 insertions, 18 deletions
diff --git a/bug/operation_pack_test.go b/bug/operation_pack_test.go
index 48f9f80c..8a8c7e62 100644
--- a/bug/operation_pack_test.go
+++ b/bug/operation_pack_test.go
@@ -5,7 +5,7 @@ import (
"testing"
"github.com/MichaelMure/git-bug/util/git"
- "github.com/go-test/deep"
+ "github.com/stretchr/testify/assert"
)
func TestOperationPackSerialize(t *testing.T) {
@@ -21,9 +21,7 @@ func TestOperationPackSerialize(t *testing.T) {
opMeta.SetMetadata("key", "value")
opp.Append(opMeta)
- if len(opMeta.Metadata) != 1 {
- t.Fatal()
- }
+ assert.Equal(t, 1, len(opMeta.Metadata))
opFile := NewCreateOp(rene, unix, "title", "message", []git.Hash{
"abcdef",
@@ -31,23 +29,14 @@ func TestOperationPackSerialize(t *testing.T) {
})
opp.Append(opFile)
- if len(opFile.Files) != 2 {
- t.Fatal()
- }
+ assert.Equal(t, 2, len(opFile.Files))
data, err := json.Marshal(opp)
- if err != nil {
- t.Fatal(err)
- }
+ assert.NoError(t, err)
var opp2 *OperationPack
err = json.Unmarshal(data, &opp2)
- if err != nil {
- t.Fatal(err)
- }
-
- deep.CompareUnexportedFields = false
- if diff := deep.Equal(opp, opp2); diff != nil {
- t.Fatal(diff)
- }
+
+ assert.NoError(t, err)
+ assert.Equal(t, opp, opp2)
}