$92 GRAYBYTE WORDPRESS FILE MANAGER $43

SERVER : in-mum-web1330.main-hosting.eu #1 SMP Mon Feb 10 22:45:17 UTC 2025
SERVER IP : 91.108.106.249 | ADMIN IP 216.73.216.215
OPTIONS : CRL = ON | WGT = ON | SDO = OFF | PKEX = OFF
DEACTIVATED : NONE

/opt/go/pkg/mod/google.golang.org/protobuf@v1.30.0/testing/prototest/

HOME
Current File : /opt/go/pkg/mod/google.golang.org/protobuf@v1.30.0/testing/prototest//enum.go
// Copyright 2020 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

import (
	"testing"

	"google.golang.org/protobuf/reflect/protoreflect"
)

// Enum tests an EnumType implementation.
type Enum struct{}

func (test Enum) Test(t testing.TB, et protoreflect.EnumType) {
	ed := et.Descriptor()
	values := ed.Values()
	for i := 0; i < values.Len(); i++ {
		evd := values.Get(i)
		num := evd.Number()
		e := et.New(num)
		if e.Descriptor() != ed {
			t.Errorf("enumType.New(%v).Descriptor() != enumType.Descriptor(), should match", num)
		}
		if e.Type() != et {
			t.Errorf("enumType.New(%v).Type() != enumType, should match", num)
		}
		if got, want := e.Number(), num; got != want {
			t.Errorf("enumType.New(%v).Number() = %v, want %v", num, got, want)
		}
	}
}

Current_dir [ NOT WRITEABLE ] Document_root [ WRITEABLE ]


[ Back ]
NAME
SIZE
LAST TOUCH
USER
CAN-I?
FUNCTIONS
..
--
25 Jan 2024 4.43 PM
root / root
0555
enum.go
0.853 KB
25 Jan 2024 4.43 PM
root / root
0444
message.go
29.072 KB
25 Jan 2024 4.43 PM
root / root
0444
prototest_test.go
1.359 KB
25 Jan 2024 4.43 PM
root / root
0444

GRAYBYTE WORDPRESS FILE MANAGER @ 2026 CONTACT ME
Static GIF