diff options
| author | Dmitry Vyukov <dvyukov@google.com> | 2018-06-18 19:45:37 +0200 |
|---|---|---|
| committer | Dmitry Vyukov <dvyukov@google.com> | 2018-06-18 19:45:37 +0200 |
| commit | e79c9d2b4369454ed5a020b3e2dc6ae536afd815 (patch) | |
| tree | efff0cc9e959f0f10f89b85889d27bf9795c4bfd /vendor/github.com/google/go-cmp/cmp/internal/testprotos | |
| parent | 27c5f59f504f562333e3cd5e715fea5cb69c396e (diff) | |
vendor: add github.com/google/go-cmp/cmp
This package simplifies diffing complex objects in tests.
Diffstat (limited to 'vendor/github.com/google/go-cmp/cmp/internal/testprotos')
| -rw-r--r-- | vendor/github.com/google/go-cmp/cmp/internal/testprotos/protos.go | 116 |
1 files changed, 116 insertions, 0 deletions
diff --git a/vendor/github.com/google/go-cmp/cmp/internal/testprotos/protos.go b/vendor/github.com/google/go-cmp/cmp/internal/testprotos/protos.go new file mode 100644 index 000000000..120c8b0e8 --- /dev/null +++ b/vendor/github.com/google/go-cmp/cmp/internal/testprotos/protos.go @@ -0,0 +1,116 @@ +// Copyright 2017, 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.md file. + +package testprotos + +func Equal(x, y Message) bool { + if x == nil || y == nil { + return x == nil && y == nil + } + return x.String() == y.String() +} + +type Message interface { + Proto() + String() string +} + +type proto interface { + Proto() +} + +type notComparable struct { + unexportedField func() +} + +type Stringer struct{ X string } + +func (s *Stringer) String() string { return s.X } + +// Project1 protocol buffers +type ( + Eagle_States int + Eagle_MissingCalls int + Dreamer_States int + Dreamer_MissingCalls int + Slap_States int + Goat_States int + Donkey_States int + SummerType int + + Eagle struct { + proto + notComparable + Stringer + } + Dreamer struct { + proto + notComparable + Stringer + } + Slap struct { + proto + notComparable + Stringer + } + Goat struct { + proto + notComparable + Stringer + } + Donkey struct { + proto + notComparable + Stringer + } +) + +// Project2 protocol buffers +type ( + Germ struct { + proto + notComparable + Stringer + } + Dish struct { + proto + notComparable + Stringer + } +) + +// Project3 protocol buffers +type ( + Dirt struct { + proto + notComparable + Stringer + } + Wizard struct { + proto + notComparable + Stringer + } + Sadistic struct { + proto + notComparable + Stringer + } +) + +// Project4 protocol buffers +type ( + HoneyStatus int + PoisonType int + MetaData struct { + proto + notComparable + Stringer + } + Restrictions struct { + proto + notComparable + Stringer + } +) |
