update deps and tests

Signed-off-by: Vasiliy Tolstov <v.tolstov@unistack.org>
This commit is contained in:
2023-02-08 14:59:33 +03:00
parent e8150c474c
commit 70e58e881c
3 changed files with 17 additions and 3 deletions

View File

@@ -7,9 +7,23 @@ import (
"testing"
"github.com/golang/protobuf/ptypes/wrappers"
pb "go.unistack.org/micro-tests/client/grpc/proto"
"go.unistack.org/micro/v3/logger/unwrap"
)
func TestProtoMessage(t *testing.T) {
type Response struct {
Val *pb.Response `logger:"take"`
}
val := &Response{Val: &pb.Response{Msg: "test"}}
buf := fmt.Sprintf("%#v", unwrap.Unwrap(val, unwrap.Tagged(true)))
cmp := `&unwrap_test.Response{Val:(*helloworld.Response){Msg:"test"}}`
if strings.Compare(buf, cmp) != 0 {
t.Fatalf("not proper written \n%s\n%s", cmp, buf)
}
}
func TestWrappers(t *testing.T) {
type CustomerInfo struct {
MainPhone *wrappers.StringValue `logger:"take"`