Damien Neil | 5ec58b9 | 2019-04-30 11:36:39 -0700 | [diff] [blame] | 1 | // 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 | |
| 5 | package prototest_test |
| 6 | |
| 7 | import ( |
| 8 | "fmt" |
| 9 | "testing" |
| 10 | |
Damien Neil | e89e624 | 2019-05-13 23:55:40 -0700 | [diff] [blame^] | 11 | testpb "google.golang.org/protobuf/internal/testprotos/test" |
| 12 | test3pb "google.golang.org/protobuf/internal/testprotos/test3" |
| 13 | "google.golang.org/protobuf/proto" |
| 14 | "google.golang.org/protobuf/testing/prototest" |
Damien Neil | 5ec58b9 | 2019-04-30 11:36:39 -0700 | [diff] [blame] | 15 | ) |
| 16 | |
| 17 | func Test(t *testing.T) { |
| 18 | for _, m := range []proto.Message{ |
| 19 | (*testpb.TestAllTypes)(nil), |
| 20 | (*test3pb.TestAllTypes)(nil), |
| 21 | (*testpb.TestRequired)(nil), |
Damien Neil | 82a0306 | 2019-05-08 07:52:49 -0700 | [diff] [blame] | 22 | (*testpb.TestWeak)(nil), |
Damien Neil | 5ec58b9 | 2019-04-30 11:36:39 -0700 | [diff] [blame] | 23 | } { |
| 24 | t.Run(fmt.Sprintf("%T", m), func(t *testing.T) { |
| 25 | prototest.TestMessage(t, m) |
| 26 | }) |
| 27 | } |
| 28 | } |