op_noop_test.go

 1package dag
 2
 3import (
 4	"encoding/json"
 5	"testing"
 6
 7	"github.com/MichaelMure/git-bug/entity"
 8)
 9
10func TestNoopSerialize(t *testing.T) {
11	SerializeRoundTripTest(t, func(raw json.RawMessage, resolver entity.Resolvers) (Operation, error) {
12		var op NoOpOperation[*snapshotMock]
13		err := json.Unmarshal(raw, &op)
14		return &op, err
15	}, func(author entity.Identity, unixTime int64) (*NoOpOperation[*snapshotMock], entity.Resolvers) {
16		return NewNoOpOp[*snapshotMock](1, author, unixTime), nil
17	})
18}