diff options
author | Michael Muré <batolettre@gmail.com> | 2022-08-01 17:16:45 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-08-01 17:16:45 +0200 |
commit | cd52872475f1b39f3fb6546606c1e78afb6c08e3 (patch) | |
tree | 9f04b1e1ee362e210e74aaa324d950058ed14bf2 /bug/operation_test.go | |
parent | 2ade8fb1d570ddcb4aedc9386af46d208b129daa (diff) | |
parent | 56966fec5562c3a0e23340d0fbe754626c3beb64 (diff) | |
download | git-bug-cd52872475f1b39f3fb6546606c1e78afb6c08e3.tar.gz git-bug-cd52872475f1b39f3fb6546606c1e78afb6c08e3.zip |
Merge pull request #835 from MichaelMure/op-base
entity/dag: proper base operation for simplified implementation
Diffstat (limited to 'bug/operation_test.go')
-rw-r--r-- | bug/operation_test.go | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/bug/operation_test.go b/bug/operation_test.go index c57a1591d..3cfc85c44 100644 --- a/bug/operation_test.go +++ b/bug/operation_test.go @@ -6,10 +6,13 @@ import ( "github.com/stretchr/testify/require" + "github.com/MichaelMure/git-bug/entity/dag" "github.com/MichaelMure/git-bug/identity" "github.com/MichaelMure/git-bug/repository" ) +// TODO: move to entity/dag? + func TestValidate(t *testing.T) { repo := repository.NewMockRepoClock() @@ -44,11 +47,7 @@ func TestValidate(t *testing.T) { NewSetStatusOp(makeIdentity(t, "René Descartes", "rene@descartes.fr\u001b"), unix, ClosedStatus), NewSetStatusOp(makeIdentity(t, "René \nDescartes", "rene@descartes.fr"), unix, ClosedStatus), NewSetStatusOp(makeIdentity(t, "René Descartes", "rene@\ndescartes.fr"), unix, ClosedStatus), - &CreateOperation{OpBase: OpBase{ - Author_: rene, - UnixTime: 0, - OperationType: CreateOp, - }, + &CreateOperation{OpBase: dag.NewOpBase(CreateOp, rene, 0), Title: "title", Message: "message", }, @@ -105,7 +104,7 @@ func TestID(t *testing.T) { err = rene.Commit(repo) require.NoError(t, err) - b, op, err := Create(rene, time.Now().Unix(), "title", "message") + b, op, err := Create(rene, time.Now().Unix(), "title", "message", nil, nil) require.NoError(t, err) id1 := op.Id() |