Skip to content

Commit

Permalink
remove oneOf assertions until I figure out how to do the nil check pr…
Browse files Browse the repository at this point in the history
…operly
  • Loading branch information
sudorandom committed Aug 18, 2024
1 parent 8871299 commit 2475cf9
Showing 1 changed file with 0 additions and 13 deletions.
13 changes: 0 additions & 13 deletions gen_msg_test.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
package fauxrpc_test

import (
"reflect"
"testing"

"google.golang.org/protobuf/reflect/protoreflect"
Expand Down Expand Up @@ -97,17 +96,5 @@ func TestGenerateMessage(t *testing.T) {
assertFieldIsSet(t, md, msg, "stringValueWrapper")
assertFieldIsSet(t, md, msg, "fieldMask")
assertFieldIsSet(t, md, msg, "enumList")

nonZeroOneOfValues := []protoreflect.Value{}
for _, val := range []protoreflect.Value{
requireFieldByName(t, md, msg, "oneofDoubleValue"),
requireFieldByName(t, md, msg, "oneofDoubleValueWrapper"),
requireFieldByName(t, md, msg, "oneofEnumValue"),
} {
if !reflect.ValueOf(val.Interface()).IsZero() {
nonZeroOneOfValues = append(nonZeroOneOfValues, val)
}
}
assert.Len(t, nonZeroOneOfValues, 1, "too many values set in oneOf group: %+v", nonZeroOneOfValues)
})
}

0 comments on commit 2475cf9

Please sign in to comment.