blob: 7e04500a5f39a7e6981e30bfe635e6e0544a3c79 [file] [log] [blame]
Damien Neil95539ea2019-08-30 10:20:26 -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
Joe Tsaicbdefb12019-09-16 09:57:27 -07005package impl_test
Damien Neil95539ea2019-08-30 10:20:26 -07006
7import (
Damien Neil95539ea2019-08-30 10:20:26 -07008 "testing"
9
Damien Neil95539ea2019-08-30 10:20:26 -070010 pref "google.golang.org/protobuf/reflect/protoreflect"
Joe Tsaicbdefb12019-09-16 09:57:27 -070011
12 testpb "google.golang.org/protobuf/internal/testprotos/test"
Damien Neil95539ea2019-08-30 10:20:26 -070013)
14
15func TestEnum(t *testing.T) {
16 et := testpb.ForeignEnum_FOREIGN_FOO.Type()
Damien Neil95539ea2019-08-30 10:20:26 -070017 if got, want := et.New(pref.EnumNumber(testpb.ForeignEnum_FOREIGN_FOO)), pref.Enum(testpb.ForeignEnum_FOREIGN_FOO); got != want {
18 t.Errorf("testpb.ForeignEnum_FOREIGN_FOO.Type().New() = %[1]T(%[1]v), want %[2]T(%[2]v)", got, want)
19 }
20}