From 67b70f61159cd547c4404ab7dd37d5c8dbbc3a8a Mon Sep 17 00:00:00 2001 From: Codey Oxley Date: Wed, 20 Nov 2024 18:05:08 -0500 Subject: [PATCH] make tests actually verify what we're trying to --- testproto/unique/unique_test.go | 6 +++--- vtproto/ext.pb.go | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/testproto/unique/unique_test.go b/testproto/unique/unique_test.go index 0fac928..6ae7bda 100644 --- a/testproto/unique/unique_test.go +++ b/testproto/unique/unique_test.go @@ -25,17 +25,17 @@ func TestUnmarshalSameMemory(t *testing.T) { m3 := &UniqueFieldExtension{} require.NoError(t, m3.UnmarshalVT(b)) - require.Equal(t, unsafe.StringData(m2.Foo), unsafe.StringData(m3.Foo)) + require.Same(t, unsafe.StringData(m2.Foo), unsafe.StringData(m3.Foo), "string field") keys2 := slices.Collect(maps.Keys(m2.Bar)) keys3 := slices.Collect(maps.Keys(m3.Bar)) require.Len(t, keys2, 1) require.Len(t, keys3, 1) - require.Equal(t, unsafe.StringData(keys2[0]), unsafe.StringData(keys3[0])) + require.Same(t, unsafe.StringData(keys2[0]), unsafe.StringData(keys3[0]), "string key") values2 := slices.Collect(maps.Values(m2.Baz)) values3 := slices.Collect(maps.Values(m3.Baz)) require.Len(t, values2, 1) require.Len(t, values2, 1) - require.Equal(t, unsafe.StringData(values2[0]), unsafe.StringData(values3[0])) + require.Same(t, unsafe.StringData(values2[0]), unsafe.StringData(values3[0]), "string value") } diff --git a/vtproto/ext.pb.go b/vtproto/ext.pb.go index 39eaa8b..e296959 100644 --- a/vtproto/ext.pb.go +++ b/vtproto/ext.pb.go @@ -28,7 +28,7 @@ type Opts struct { sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - Unique *bool `protobuf:"varint,1,opt,name=unique" json:"unique,omitempty"` // optional bool unique_keys = 2; + Unique *bool `protobuf:"varint,1,opt,name=unique" json:"unique,omitempty"` } func (x *Opts) Reset() {