From fb0c5fd06184f33a03d8d4fb29a3aef8b1dafe78 Mon Sep 17 00:00:00 2001 From: Michael Muré Date: Sun, 8 Nov 2020 17:54:28 +0100 Subject: repo: expose all lamport clocks, move clocks in their own folder --- bug/op_set_title_test.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'bug/op_set_title_test.go') diff --git a/bug/op_set_title_test.go b/bug/op_set_title_test.go index 368ada61..df27ee35 100644 --- a/bug/op_set_title_test.go +++ b/bug/op_set_title_test.go @@ -14,7 +14,7 @@ import ( ) func TestSetTitleSerialize(t *testing.T) { - repo := repository.NewMockRepoForTest() + repo := repository.NewMockRepo() rene := identity.NewIdentity("René Descartes", "rene@descartes.fr") err := rene.Commit(repo) require.NoError(t, err) -- cgit From 7163b2283b4542a4d4abfe9a71963f122322bde7 Mon Sep 17 00:00:00 2001 From: Michael Muré Date: Sun, 8 Nov 2020 19:15:06 +0100 Subject: bug: Id from first operation data, not git + remove root link --- bug/op_set_title_test.go | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) (limited to 'bug/op_set_title_test.go') diff --git a/bug/op_set_title_test.go b/bug/op_set_title_test.go index df27ee35..6ae325be 100644 --- a/bug/op_set_title_test.go +++ b/bug/op_set_title_test.go @@ -9,32 +9,30 @@ import ( "github.com/MichaelMure/git-bug/identity" "github.com/MichaelMure/git-bug/repository" - - "github.com/stretchr/testify/assert" ) func TestSetTitleSerialize(t *testing.T) { repo := repository.NewMockRepo() - rene := identity.NewIdentity("René Descartes", "rene@descartes.fr") - err := rene.Commit(repo) + + rene, err := identity.NewIdentity(repo, "René Descartes", "rene@descartes.fr") require.NoError(t, err) unix := time.Now().Unix() before := NewSetTitleOp(rene, unix, "title", "was") data, err := json.Marshal(before) - assert.NoError(t, err) + require.NoError(t, err) var after SetTitleOperation err = json.Unmarshal(data, &after) - assert.NoError(t, err) + require.NoError(t, err) // enforce creating the ID before.Id() // Replace the identity stub with the real thing - assert.Equal(t, rene.Id(), after.base().Author.Id()) + require.Equal(t, rene.Id(), after.base().Author.Id()) after.Author = rene - assert.Equal(t, before, &after) + require.Equal(t, before, &after) } -- cgit From 3f6ef50883492f77995a7e27872d0b5ae17b9d6a Mon Sep 17 00:00:00 2001 From: Michael Muré Date: Sun, 14 Feb 2021 11:36:32 +0100 Subject: bug: migrate to the DAG entity structure! --- bug/op_set_title_test.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'bug/op_set_title_test.go') diff --git a/bug/op_set_title_test.go b/bug/op_set_title_test.go index 6ae325be..7059c4c7 100644 --- a/bug/op_set_title_test.go +++ b/bug/op_set_title_test.go @@ -31,8 +31,8 @@ func TestSetTitleSerialize(t *testing.T) { before.Id() // Replace the identity stub with the real thing - require.Equal(t, rene.Id(), after.base().Author.Id()) - after.Author = rene + require.Equal(t, rene.Id(), after.Author().Id()) + after.Author_ = rene require.Equal(t, before, &after) } -- cgit