-
Notifications
You must be signed in to change notification settings - Fork 77
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix marshalling of empty oneOf messages
Fixes #61
- Loading branch information
1 parent
ec98e72
commit c067ecd
Showing
8 changed files
with
150 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
package conformance | ||
|
||
import ( | ||
"testing" | ||
|
||
"github.com/stretchr/testify/require" | ||
"google.golang.org/protobuf/proto" | ||
) | ||
|
||
func TestEmptyOneoff(t *testing.T) { | ||
// Regression test for https://github.com/planetscale/vtprotobuf/issues/61 | ||
msg := &TestAllTypesProto3{OneofField: &TestAllTypesProto3_OneofNestedMessage{}} | ||
upstream, _ := proto.Marshal(msg) | ||
vt, _ := msg.MarshalVTStrict() | ||
require.Equal(t, upstream, vt) | ||
} |
14 changes: 14 additions & 0 deletions
14
conformance/internal/conformance/test_messages_proto2_vtproto.pb.go
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
14 changes: 14 additions & 0 deletions
14
conformance/internal/conformance/test_messages_proto3_vtproto.pb.go
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Oops, something went wrong.