reg/vendor/github.com/gogo/protobuf/test/merge/merge_test.go
Jess Frazelle 58cebbaa58
switch to new cli package and update generated files and deps
Signed-off-by: Jess Frazelle <acidburn@microsoft.com>
2018-07-15 17:48:35 -04:00

37 lines
518 B
Go

package merge
import (
"testing"
"github.com/gogo/protobuf/proto"
)
func TestClone1(t *testing.T) {
f1 := &A{}
proto.Clone(f1)
}
func TestMerge1(t *testing.T) {
f1 := &A{}
f2 := &A{}
proto.Merge(f1, f2)
}
func TestMerge2(t *testing.T) {
f1 := &A{B: B{C: 1}}
f2 := &A{}
proto.Merge(f1, f2)
if f1.B.C != 1 {
t.Fatalf("got %d want %d", f1.B.C, 1)
}
}
func TestMerge3(t *testing.T) {
f1 := &A{}
f2 := &A{B: B{C: 1}}
proto.Merge(f1, f2)
if f1.B.C != 1 {
t.Fatalf("got %d want %d", f1.B.C, 1)
}
}