blob: 74ade176f5e3d307cd743eaf74556e6a4b60c07a [file] [log] [blame]
Damien Neil5ec58b92019-04-30 11:36:39 -07001// Copyright 2019 The Go Authors. All rights reserved.
2// Use of this source code is governed by a BSD-style
3// license that can be found in the LICENSE file.
4
5package prototest_test
6
7import (
8 "fmt"
9 "testing"
10
Damien Neil5b6d0472019-06-14 11:54:07 -070011 irregularpb "google.golang.org/protobuf/internal/testprotos/irregular"
Damien Neile89e6242019-05-13 23:55:40 -070012 testpb "google.golang.org/protobuf/internal/testprotos/test"
13 test3pb "google.golang.org/protobuf/internal/testprotos/test3"
14 "google.golang.org/protobuf/proto"
15 "google.golang.org/protobuf/testing/prototest"
Damien Neil5ec58b92019-04-30 11:36:39 -070016)
17
18func Test(t *testing.T) {
19 for _, m := range []proto.Message{
20 (*testpb.TestAllTypes)(nil),
21 (*test3pb.TestAllTypes)(nil),
22 (*testpb.TestRequired)(nil),
Damien Neil82a03062019-05-08 07:52:49 -070023 (*testpb.TestWeak)(nil),
Damien Neil5b6d0472019-06-14 11:54:07 -070024 (*irregularpb.Message)(nil),
Damien Neild91246e2019-06-21 08:36:26 -070025 (*testpb.TestAllExtensions)(nil),
Damien Neil5ec58b92019-04-30 11:36:39 -070026 } {
27 t.Run(fmt.Sprintf("%T", m), func(t *testing.T) {
Damien Neild91246e2019-06-21 08:36:26 -070028 prototest.TestMessage(t, m, prototest.MessageOptions{})
Damien Neil5ec58b92019-04-30 11:36:39 -070029 })
30 }
31}