aboutsummaryrefslogtreecommitdiffstats
path: root/bug/operation_test.go
diff options
context:
space:
mode:
authorMichael Muré <batolettre@gmail.com>2022-07-25 13:16:16 +0200
committerMichael Muré <batolettre@gmail.com>2022-07-25 13:27:17 +0200
commit3d454d9dc8ba2409046c0938618a70864e6eb8ef (patch)
tree8745f656cc8218654632ce003f997a39988d3043 /bug/operation_test.go
parent2ade8fb1d570ddcb4aedc9386af46d208b129daa (diff)
downloadgit-bug-3d454d9dc8ba2409046c0938618a70864e6eb8ef.tar.gz
entity/dag: proper base operation for simplified implementation
- reduce boilerplace necessary to implement an operation - consolidate what an operation is in the core, which in turn pave the way for a generic cache layer mechanism - avoid the previously complex unmarshalling process - support operation metadata from the core - simplified testing
Diffstat (limited to 'bug/operation_test.go')
-rw-r--r--bug/operation_test.go9
1 files changed, 4 insertions, 5 deletions
diff --git a/bug/operation_test.go b/bug/operation_test.go
index c57a1591..d95ffff2 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",
},