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-06-14 18:54:07 +00:00
|
|
|
irregularpb "google.golang.org/protobuf/internal/testprotos/irregular"
|
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-06-14 18:54:07 +00:00
|
|
|
(*irregularpb.Message)(nil),
|
2019-06-21 15:36:26 +00:00
|
|
|
(*testpb.TestAllExtensions)(nil),
|
2019-04-30 18:36:39 +00:00
|
|
|
} {
|
|
|
|
t.Run(fmt.Sprintf("%T", m), func(t *testing.T) {
|
2019-06-21 15:36:26 +00:00
|
|
|
prototest.TestMessage(t, m, prototest.MessageOptions{})
|
2019-04-30 18:36:39 +00:00
|
|
|
})
|
|
|
|
}
|
|
|
|
}
|