2019-04-30 18:36:39 +00:00
|
|
|
// Copyright 2019 The Go Authors. All rights reserved.
|
|
|
|
// Use of this source code is governed by a BSD-style
|
|
|
|
// license that can be found in the LICENSE file.
|
|
|
|
|
|
|
|
package prototest_test
|
|
|
|
|
|
|
|
import (
|
|
|
|
"fmt"
|
|
|
|
"testing"
|
|
|
|
|
2019-05-14 06:55:40 +00:00
|
|
|
testpb "google.golang.org/protobuf/internal/testprotos/test"
|
|
|
|
test3pb "google.golang.org/protobuf/internal/testprotos/test3"
|
|
|
|
"google.golang.org/protobuf/proto"
|
|
|
|
"google.golang.org/protobuf/testing/prototest"
|
2019-04-30 18:36:39 +00:00
|
|
|
)
|
|
|
|
|
|
|
|
func Test(t *testing.T) {
|
|
|
|
for _, m := range []proto.Message{
|
|
|
|
(*testpb.TestAllTypes)(nil),
|
|
|
|
(*test3pb.TestAllTypes)(nil),
|
|
|
|
(*testpb.TestRequired)(nil),
|
2019-05-08 14:52:49 +00:00
|
|
|
(*testpb.TestWeak)(nil),
|
2019-04-30 18:36:39 +00:00
|
|
|
} {
|
|
|
|
t.Run(fmt.Sprintf("%T", m), func(t *testing.T) {
|
|
|
|
prototest.TestMessage(t, m)
|
|
|
|
})
|
|
|
|
}
|
|
|
|
}
|