aboutsummaryrefslogblamecommitdiffstats
path: root/entities/bug/op_label_change_test.go
blob: edbe47144bf800b8bf83ff0e29138e192a033da7 (plain) (tree)
1
2
3
4
5
6
7
8
9
10


           
                 
 
                                                          
                                                   


                                             








                                                                                                             
 
package bug

import (
	"testing"

	"github.com/MichaelMure/git-bug/entities/identity"
	"github.com/MichaelMure/git-bug/entity/dag"
)

func TestLabelChangeSerialize(t *testing.T) {
	dag.SerializeRoundTripTest(t, func(author identity.Interface, unixTime int64) *LabelChangeOperation {
		return NewLabelChangeOperation(author, unixTime, []Label{"added"}, []Label{"removed"})
	})
	dag.SerializeRoundTripTest(t, func(author identity.Interface, unixTime int64) *LabelChangeOperation {
		return NewLabelChangeOperation(author, unixTime, []Label{"added"}, nil)
	})
	dag.SerializeRoundTripTest(t, func(author identity.Interface, unixTime int64) *LabelChangeOperation {
		return NewLabelChangeOperation(author, unixTime, nil, []Label{"removed"})
	})
}